• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)


Commit MetaInfo

Revision3b50783ec354c8ae306db8680e492b8df5eb8813 (tree)
Time2022-08-25 22:15:20
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Added an optional parameter to GAMEMODE_HandleEvent that decides whether the event script is executed immediately or not. By default, this is set to false.

Change Summary

Incremental Difference

diff -r d5b440d54c74 -r 3b50783ec354 src/chat.cpp
--- a/src/chat.cpp Thu Aug 25 08:24:19 2022 -0400
+++ b/src/chat.cpp Thu Aug 25 09:15:20 2022 -0400
@@ -1087,7 +1087,7 @@
10871087
10881088 // [AK] Trigger an event script indicating that a chat message was received.
10891089 // If the event returns 0, then don't print the message.
1090- if ( GAMEMODE_HandleEvent( GAMEEVENT_CHAT, NULL, ulPlayer != MAXPLAYERS ? ulPlayer : -1, ulMode - CHATMODE_GLOBAL ) == 0 )
1090+ if ( GAMEMODE_HandleEvent( GAMEEVENT_CHAT, NULL, ulPlayer != MAXPLAYERS ? ulPlayer : -1, ulMode - CHATMODE_GLOBAL, true ) == 0 )
10911091 return;
10921092
10931093 BOTCMD_SetLastChatString( ChatString );
diff -r d5b440d54c74 -r 3b50783ec354 src/gamemode.cpp
--- a/src/gamemode.cpp Thu Aug 25 08:24:19 2022 -0400
+++ b/src/gamemode.cpp Thu Aug 25 09:15:20 2022 -0400
@@ -1079,7 +1079,7 @@
10791079
10801080 //*****************************************************************************
10811081 //
1082-LONG GAMEMODE_HandleEvent ( const GAMEEVENT_e Event, AActor *pActivator, const int DataOne, const int DataTwo, const int OverrideResult )
1082+LONG GAMEMODE_HandleEvent ( const GAMEEVENT_e Event, AActor *pActivator, const int DataOne, const int DataTwo, const bool bRunNow, const int OverrideResult )
10831083 {
10841084 // [BB] Clients don't start scripts.
10851085 if ( NETWORK_InClientMode() )
@@ -1091,13 +1091,6 @@
10911091 const LONG lOldResult = GAMEMODE_GetEventResult( );
10921092 GAMEMODE_SetEventResult( OverrideResult );
10931093
1094- // [AK] Allow events that are triggered by an actor spawning or
1095- // taking damage to be executed immediately, in case any of the
1096- // actor pointers that were responsible for calling the event
1097- // become NULL after one tic.
1098- // Also allow chat events to be executed immediately.
1099- const bool bRunNow = ( Event == GAMEEVENT_ACTOR_SPAWNED || Event == GAMEEVENT_ACTOR_DAMAGED || Event == GAMEEVENT_ACTOR_ARMORDAMAGED || Event == GAMEEVENT_CHAT );
1100-
11011094 // [BB] The activator of the event activates the event script.
11021095 // The first argument is the type, e.g. GAMEEVENT_PLAYERFRAGS,
11031096 // the second and third are specific to the event, e.g. the second is the number of the fragged player.
@@ -1138,7 +1131,7 @@
11381131 temp->master = source;
11391132 temp->tracer = inflictor;
11401133
1141- damage = GAMEMODE_HandleEvent( DamageEvent, temp, damage, GlobalACSStrings.AddString( mod ), damage );
1134+ damage = GAMEMODE_HandleEvent( DamageEvent, temp, damage, GlobalACSStrings.AddString( mod ), true, damage );
11421135
11431136 // [AK] Destroy the temporary actor after executing all event scripts.
11441137 temp->Destroy( );
diff -r d5b440d54c74 -r 3b50783ec354 src/gamemode.h
--- a/src/gamemode.h Thu Aug 25 08:24:19 2022 -0400
+++ b/src/gamemode.h Thu Aug 25 09:15:20 2022 -0400
@@ -213,7 +213,7 @@
213213 bool GAMEMODE_IsHandledSpecial ( AActor *Activator, int Special );
214214 GAMESTATE_e GAMEMODE_GetState ( void );
215215 void GAMEMODE_SetState ( GAMESTATE_e GameState );
216-LONG GAMEMODE_HandleEvent ( const GAMEEVENT_e Event, AActor *pActivator = NULL, const int DataOne = 0, const int DataTwo = 0, const int OverrideResult = 1 );
216+LONG GAMEMODE_HandleEvent ( const GAMEEVENT_e Event, AActor *pActivator = NULL, const int DataOne = 0, const int DataTwo = 0, const bool bRunNow = false, const int OverrideResult = 1 );
217217 bool GAMEMODE_HandleDamageEvent ( AActor *target, AActor *inflictor, AActor *source, int &damage, FName mod, bool bBeforeArmor = false );
218218 LONG GAMEMODE_GetEventResult ( void );
219219 void GAMEMODE_SetEventResult ( LONG lResult );
diff -r d5b440d54c74 -r 3b50783ec354 src/p_mobj.cpp
--- a/src/p_mobj.cpp Thu Aug 25 08:24:19 2022 -0400
+++ b/src/p_mobj.cpp Thu Aug 25 09:15:20 2022 -0400
@@ -5205,7 +5205,7 @@
52055205 // [AK] If we want to force GAMEEVENT_ACTOR_SPAWNED on every actor, then at least ignore
52065206 // the less imporant actors unless they have the USESPAWNEVENTSCRIPT flag enabled.
52075207 if (( STFlags & STFL_USESPAWNEVENTSCRIPT ) || (( gameinfo.bForceSpawnEventScripts ) && ( bNotImportant == false )))
5208- GAMEMODE_HandleEvent( GAMEEVENT_ACTOR_SPAWNED, this, !!( STFlags & STFL_LEVELSPAWNED ));
5208+ GAMEMODE_HandleEvent( GAMEEVENT_ACTOR_SPAWNED, this, !!( STFlags & STFL_LEVELSPAWNED ), 0, true );
52095209 }
52105210 }
52115211
diff -r d5b440d54c74 -r 3b50783ec354 src/sv_main.cpp
--- a/src/sv_main.cpp Thu Aug 25 08:24:19 2022 -0400
+++ b/src/sv_main.cpp Thu Aug 25 09:15:20 2022 -0400
@@ -1219,7 +1219,7 @@
12191219
12201220 // [AK] Trigger an event script indicating that a chat message was received.
12211221 // If the event returns 0, then don't print the message or send it to the clients.
1222- if ( GAMEMODE_HandleEvent( GAMEEVENT_CHAT, NULL, ulPlayer != MAXPLAYERS ? ulPlayer : -1, ulMode - CHATMODE_GLOBAL ) == 0 )
1222+ if ( GAMEMODE_HandleEvent( GAMEEVENT_CHAT, NULL, ulPlayer != MAXPLAYERS ? ulPlayer : -1, ulMode - CHATMODE_GLOBAL, true ) == 0 )
12231223 return;
12241224
12251225 SERVERCOMMANDS_PlayerSay( ulPlayer, pszString, ulMode, bForbidChatToPlayers );