Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exported thing activation function #2895

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/playsim/p_lnspec.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static inline bool P_IsACSSpecial(int specnum)
FLineSpecial *P_GetLineSpecialInfo(int num);
int P_GetMaxLineSpecial();
int P_FindLineSpecial (const char *string, int *min_args=NULL, int *max_args=NULL);
bool P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death=false);
int P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death=false);
int P_ExecuteSpecial(
FLevelLocals *lev,
int num,
Expand Down
10 changes: 9 additions & 1 deletion src/playsim/p_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7211,7 +7211,7 @@ static void SpawnDeepSplash(AActor *t1, const FTraceResults &trace, AActor *puff
//
//=============================================================================

bool P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death)
int P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death)
{
bool res = false;

Expand Down Expand Up @@ -7267,3 +7267,11 @@ bool P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death)
// Returns the result
return res;
}

DEFINE_ACTION_FUNCTION_NATIVE(AActor, ActivateSpecial, P_ActivateThingSpecial)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(activator, AActor);
PARAM_BOOL(death);
ACTION_RETURN_BOOL(P_ActivateThingSpecial(self, activator, death));
}
1 change: 1 addition & 0 deletions wadsrc/static/zscript/actors/actor.zs
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ class Actor : Thinker native
native clearscope static int ApplyDamageFactors(class<Inventory> itemcls, Name damagetype, int damage, int defdamage);
native void RemoveFromHash();
native void ChangeTid(int newtid);
native bool ActivateSpecial(Actor activator, bool death = false);
deprecated("3.8", "Use Level.FindUniqueTid() instead") static int FindUniqueTid(int start = 0, int limit = 0)
{
return level.FindUniqueTid(start, limit);
Expand Down