]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Wrap engine events
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 19 Jun 2016 07:42:56 +0000 (17:42 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 19 Jun 2016 07:42:56 +0000 (17:42 +1000)
17 files changed:
qcsrc/client/main.qc
qcsrc/client/view.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/physics/player.qc
qcsrc/lib/_all.inc
qcsrc/server/bot/bot.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/cl_client.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/playerdemo.qc
qcsrc/server/sv_main.qc
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh

index c62a72e6e9303cfa41ae3d888ad5d0e6bed175aa..963cc9e418d6b8b153048486c5bc45139a63b981 100644 (file)
@@ -780,8 +780,8 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new)
 
 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
-void CSQC_Ent_Update(bool isnew)
-{ENGINE_EVENT();
+void CSQC_Ent_Update(entity this, bool isnew)
+{
        this.sourceLoc = __FILE__ ":" STR(__LINE__);
        int t = ReadByte();
 
@@ -860,8 +860,8 @@ void Ent_Remove(entity this)
        // TODO possibly set more stuff to defaults
 }
 // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed.  Essentially call remove(this) as well.
-void CSQC_Ent_Remove()
-{ENGINE_EVENT();
+void CSQC_Ent_Remove(entity this)
+{
        if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}\n", this, this.entnum, this.enttype);
        if (wasfreed(this))
        {
index 5cb3c18c1f15ab4af2098d5f8c7cd18c4924f835..af7eb35b338418556d0ceda77c9690910ff85352 100644 (file)
@@ -1369,8 +1369,8 @@ float prev_myteam;
 int lasthud;
 float vh_notice_time;
 void WaypointSprite_Load();
-void CSQC_UpdateView(float w, float h)
-{ENGINE_EVENT();
+void CSQC_UpdateView(entity this, float w, float h)
+{
     TC(int, w); TC(int, h);
        entity e;
        float fov;
index 2c529827098ca7d6f28e2f20ff1d8cbc51285e23..9a30445ace86c042517f62ede9b19a360e0dbdfb 100644 (file)
@@ -1759,7 +1759,7 @@ MUTATOR_HOOKFUNCTION(ons, reset_map_global)
        FOREACH_CLIENT(IS_PLAYER(it), {
                it.ons_roundlost = false;
                it.ons_deathloc = '0 0 0';
-               WITHSELF(it, PutClientInServer());
+               PutClientInServer(it);
        });
        return false;
 }
index d70717ac5e983eeff9690ee6200a51662e638ca0..c0960125597e93d76cf17a8e60e05cf2a5cc52f8 100644 (file)
@@ -1549,13 +1549,10 @@ LABEL(end)
 }
 
 #if defined(SVQC)
-void SV_PlayerPhysics()
+void SV_PlayerPhysics(entity this)
 #elif defined(CSQC)
 void CSQC_ClientMovement_PlayerMove_Frame(entity this)
 #endif
 {
-#ifdef SVQC
-       ENGINE_EVENT();
-#endif
        PM_Main(this);
 }
index 03b943625832c472670d76169a58a8ba32195684..61755fe94322e1d360390792823fcb0d9ed77d6e 100644 (file)
 #include "macro.qh"
 
 #if NDEBUG
-    #define TC(T, sym) MACRO_BEGIN MACRO_END
+       #define TC(T, sym) MACRO_BEGIN MACRO_END
 #else
-    #define TC(T, sym) MACRO_BEGIN \
-        if (!is_##T(sym)) { \
-            LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
-            isnt_##T(sym); \
-        } \
-    MACRO_END
+       #define TC(T, sym) MACRO_BEGIN \
+               if (!is_##T(sym)) { \
+                       LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
+                       isnt_##T(sym); \
+               } \
+       MACRO_END
 #endif
 
-#define   is_float(        this) (true || ftoe(this))
-#define isnt_float(        this)
-#define   is_vector(       this) (true || vtos(this))
-#define isnt_vector(       this)
-#define   is_string(       this) (true || stof(this))
-#define isnt_string(       this)
-#define   is_entity(       this) (true || etof(this))
-#define isnt_entity(       this)
-bool      is_int(    float this) { return this == floor(this); }
-void    isnt_int(    float this) { print(ftos(this)); }
-bool      is_bool(   float this) { return this == true || this == false; }
-void    isnt_bool(   float this) { print(ftos(this)); }
+#define   is_float(this) (true || ftoe(this))
+#define isnt_float(this)
+#define   is_vector(this) (true || vtos(this))
+#define isnt_vector(this)
+#define   is_string(this) (true || stof(this))
+#define isnt_string(this)
+#define   is_entity(this) (true || etof(this))
+#define isnt_entity(this)
+bool      is_int(float this) { return this == floor(this); }
+void    isnt_int(float this) { print(ftos(this)); }
+bool      is_bool(float this) { return this == true || this == false; }
+void    isnt_bool(float this) { print(ftos(this)); }
 
 #include "warpzone/mathlib.qc"
 
@@ -110,3 +110,129 @@ void    isnt_bool(   float this) { print(ftos(this)); }
 #include "yenc.qh"
 
 #include "matrix/_mod.inc"
+
+#ifdef MENUQC
+       void _m_init();
+       void m_init() { if (_m_init) _m_init(); }
+       #define m_init _m_init
+
+       void _m_shutdown();
+       void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
+       #define m_shutdown _m_shutdown
+
+       void _m_draw(float width, float height);
+       void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
+       #define m_draw _m_draw
+
+       void _m_keydown(int keynr, int ascii);
+       void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
+       #define m_keydown _m_keydown
+
+       void _m_toggle(int mode);
+       void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
+       #define m_toggle _m_toggle
+#endif
+
+#ifdef SVQC
+       void _main();
+       void main() { if (_main) _main(); }
+       #define main _main
+
+       void _SV_Shutdown();
+       void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
+       #define SV_Shutdown _SV_Shutdown
+
+       void _StartFrame();
+       void StartFrame() { if (_StartFrame) _StartFrame(); }
+       #define StartFrame _StartFrame
+
+       void _SetNewParms();
+       void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
+       #define SetNewParms _SetNewParms
+
+       void _SetChangeParms(entity this);
+       void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
+       #define SetChangeParms _SetChangeParms
+
+       void _ClientConnect(entity this);
+       void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
+       #define ClientConnect _ClientConnect
+
+       void _ClientDisconnect(entity this);
+       void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
+       #define ClientDisconnect _ClientDisconnect
+
+       void _PutClientInServer(entity this);
+       void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
+       #define PutClientInServer _PutClientInServer
+
+       void _ClientKill(entity this);
+       void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
+       #define ClientKill _ClientKill
+
+       void _PlayerPreThink(entity this);
+       void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
+       #define PlayerPreThink _PlayerPreThink
+
+       void _PlayerPostThink(entity this);
+       void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
+       #define PlayerPostThink _PlayerPostThink
+
+       void _SV_PlayerPhysics(entity this);
+       void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
+       #define SV_PlayerPhysics _SV_PlayerPhysics
+
+       void _SV_OnEntityPreSpawnFunction(entity this);
+       void SV_OnEntityPreSpawnFunction()
+       {
+               ENGINE_EVENT();
+               if (_SV_OnEntityPreSpawnFunction) _SV_OnEntityPreSpawnFunction(this);
+       }
+       #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction
+
+       void _SV_ChangeTeam(entity this, int _color);
+       void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
+       #define SV_ChangeTeam _SV_ChangeTeam
+
+       void _SV_ParseClientCommand(entity this, string command);
+       void SV_ParseClientCommand(string command)
+       {
+               ENGINE_EVENT();
+               if (_SV_ParseClientCommand) _SV_ParseClientCommand(this, command);
+       }
+       #define SV_ParseClientCommand _SV_ParseClientCommand
+#endif
+
+#ifdef CSQC
+       void _CSQC_Init();
+       void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
+       #define CSQC_Init _CSQC_Init
+
+       void _CSQC_Shutdown();
+       void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
+       #define CSQC_Shutdown _CSQC_Shutdown
+
+       void _CSQC_UpdateView(entity this, float w, float h);
+       void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
+       #define CSQC_UpdateView _CSQC_UpdateView
+
+       bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
+       bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
+       {
+               return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
+       }
+       #define CSQC_InputEvent _CSQC_InputEvent
+
+       bool _CSQC_ConsoleCommand(string s);
+       bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
+       #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
+
+       void _CSQC_Ent_Update(entity this, bool isNew);
+       void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
+       #define CSQC_Ent_Update _CSQC_Ent_Update
+
+       void _CSQC_Ent_Remove(entity this);
+       void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
+       #define CSQC_Ent_Remove _CSQC_Ent_Remove
+#endif
+#undef ENGINE_EVENT
index f9afb39d8ac89f5c45944dff159abc9a1ec05721..8707a03bd4d9b7d0070f6a71b6503f2ed9aef5cc 100644 (file)
@@ -43,8 +43,8 @@ entity bot_spawn()
        {
                currentbots = currentbots + 1;
                bot_setnameandstuff(bot);
-               WITHSELF(bot, ClientConnect());
-               WITHSELF(bot, PutClientInServer());
+               ClientConnect(bot);
+               PutClientInServer(bot);
        }
        return bot;
 }
index 3734ad8501c815c463719cf3bc6bebd409b3dfa8..01a1117c9f018332b598f4b39cb6bec4a13220c2 100644 (file)
@@ -476,10 +476,9 @@ void bot_list_commands()
 // Commands code
 .int bot_exec_status;
 
-void SV_ParseClientCommand(string s);
 float bot_cmd_cc(entity this)
 {
-       WITHSELF(this, SV_ParseClientCommand(bot_cmd.bot_cmd_parm_string));
+       SV_ParseClientCommand(this, bot_cmd.bot_cmd_parm_string);
        return CMD_STATUS_FINISHED;
 }
 
index 1298ae4fe675d107b1141d0b64b1c09e60582cdb..608895b4e77cc630e2e84bb2ec8f20e4236f3ba1 100644 (file)
 
 STATIC_METHOD(Client, Add, void(Client this, int _team))
 {
-    WITHSELF(this, ClientConnect());
+    ClientConnect(this);
     TRANSMUTE(Player, this);
     this.frame = 12; // 7
     this.team = _team;
-    WITHSELF(this, PutClientInServer());
+    PutClientInServer(this);
 }
 
 void PutObserverInServer(entity this);
-void ClientDisconnect();
 
 STATIC_METHOD(Client, Remove, void(Client this))
 {
     TRANSMUTE(Observer, this);
-    WITHSELF(this, PutClientInServer());
-    WITHSELF(this, ClientDisconnect());
+    PutClientInServer(this);
+    ClientDisconnect(this);
 }
 
 void send_CSQC_teamnagger() {
@@ -440,8 +439,8 @@ void FixPlayermodel(entity player)
 
 
 /** Called when a client spawns in the server */
-void PutClientInServer()
-{ENGINE_EVENT();
+void PutClientInServer(entity this)
+{
        if (IS_BOT_CLIENT(this)) {
                TRANSMUTE(Player, this);
        } else if (IS_REAL_CLIENT(this)) {
@@ -731,8 +730,8 @@ void SetNewParms ()
 SetChangeParms
 =============
 */
-void SetChangeParms ()
-{ENGINE_EVENT();
+void SetChangeParms (entity this)
+{
        // save parms for level change
        parm1 = this.parm_idlesince - time;
 
@@ -779,7 +778,7 @@ void ClientKill_Now_TeamChange(entity this)
                PutObserverInServer(this);
        }
        else
-               WITHSELF(this, SV_ChangeTeam(this.killindicator_teamchange - 1));
+               SV_ChangeTeam(this, this.killindicator_teamchange - 1);
        this.killindicator_teamchange = 0;
 }
 
@@ -946,8 +945,8 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change,
 
 }
 
-void ClientKill ()
-{ENGINE_EVENT();
+void ClientKill (entity this)
+{
        if(gameover) return;
        if(this.player_blocked) return;
        if(STAT(FROZEN, this)) return;
@@ -1016,8 +1015,8 @@ ClientConnect
 Called when a client connects to the server
 =============
 */
-void ClientConnect()
-{ENGINE_EVENT();
+void ClientConnect(entity this)
+{
        if (Ban_MaybeEnforceBanOnce(this)) return;
        assert(!IS_CLIENT(this), return);
        this.flags |= FL_CLIENT;
@@ -1172,8 +1171,8 @@ Called when a client disconnects from the server
 */
 .entity chatbubbleentity;
 void ReadyCount();
-void ClientDisconnect()
-{ENGINE_EVENT();
+void ClientDisconnect(entity this)
+{
        assert(IS_CLIENT(this), return);
 
        PlayerStats_GameReport_FinalizePlayer(this);
@@ -1300,7 +1299,7 @@ void respawn(entity this)
        CopyBody(this, 1);
 
        this.effects |= EF_NODRAW; // prevent another CopyBody
-       WITHSELF(this, PutClientInServer());
+       PutClientInServer(this);
 }
 
 void play_countdown(entity this, float finished, Sound samp)
@@ -1797,7 +1796,7 @@ void LeaveSpectatorMode(entity this)
 
                        Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_PREVENT_JOIN);
 
-                       WITHSELF(this, PutClientInServer());
+                       PutClientInServer(this);
 
                        if(IS_PLAYER(this)) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), this.netname); }
                }
@@ -1968,7 +1967,7 @@ void SpectatorThink(entity this)
                                TRANSMUTE(Spectator, this);
                        } else {
                                TRANSMUTE(Observer, this);
-                               WITHSELF(this, PutClientInServer());
+                               PutClientInServer(this);
                        }
                        this.impulse = 0;
                } else if(this.impulse == 12 || this.impulse == 16  || this.impulse == 19 || (this.impulse >= 220 && this.impulse <= 229)) {
@@ -1977,13 +1976,13 @@ void SpectatorThink(entity this)
                                TRANSMUTE(Spectator, this);
                        } else {
                                TRANSMUTE(Observer, this);
-                               WITHSELF(this, PutClientInServer());
+                               PutClientInServer(this);
                        }
                        this.impulse = 0;
                } else if (PHYS_INPUT_BUTTON_ATCK2(this)) {
                        this.flags &= ~FL_JUMPRELEASED;
                        TRANSMUTE(Observer, this);
-                       WITHSELF(this, PutClientInServer());
+                       PutClientInServer(this);
                } else {
                        if(!SpectateUpdate(this))
                                PutObserverInServer(this);
@@ -2065,8 +2064,8 @@ Called every frame for each client before the physics are run
 .float usekeypressed;
 .float last_vehiclecheck;
 .int items_added;
-void PlayerPreThink ()
-{ENGINE_EVENT();
+void PlayerPreThink (entity this)
+{
        WarpZone_PlayerPhysics_FixVAngle(this);
 
     STAT(GAMESTARTTIME, this) = game_starttime;
@@ -2414,8 +2413,8 @@ Called every frame for each client after the physics are run
 =============
 */
 .float idlekick_lasttimeleft;
-void PlayerPostThink ()
-{ENGINE_EVENT();
+void PlayerPostThink (entity this)
+{
        if (sv_maxidle > 0)
        if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
        if (IS_REAL_CLIENT(this))
index 2ede443b362401cd687f02d1bdb1cb469983ad3d..13c883f36b8619c79947b229a7322357d0a3d0e0 100644 (file)
@@ -177,7 +177,7 @@ void ClientCommand_join(entity caller, float request)
                                                PlayerScore_Clear(caller);
                                                Kill_Notification(NOTIF_ONE_ONLY, caller, MSG_CENTER, CPID_PREVENT_JOIN);
                                                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && caller.team != -1) ? APP_TEAM_ENT(caller, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), caller.netname);
-                                               WITHSELF(caller, PutClientInServer());
+                                               PutClientInServer(caller);
                                        }
                                        else
                                        {
@@ -704,8 +704,8 @@ void ClientCommand_macro_write_aliases(float fh)
 // ======================================
 // If this function exists, server game code parses clientcommand before the engine code gets it.
 
-void SV_ParseClientCommand(string command)
-{ENGINE_EVENT();
+void SV_ParseClientCommand(entity this, string command)
+{
        // If invalid UTF-8, don't even parse it
        string command2 = "";
        float len = strlen(command);
index 337b428c5566defe5b16d15f2cfd4bb3310490b7..0aa48c2fe705884650d4c3a258c4dbe20cbc677b 100644 (file)
@@ -378,7 +378,7 @@ void reset_map(bool dorespawn)
                                                it.velocity = '0 0 0';
                                                it.avelocity = '0 0 0';
                                                it.movement = '0 0 0';
-                                               WITHSELF(it, PutClientInServer());
+                                               PutClientInServer(it);
                                        }
                                }
                        ));
index 901a04f2a72cd1889b22daa3916267a2693b33a4..2a8da29c275210b8646a31ba08bae7a0a6bc3d1f 100644 (file)
@@ -254,7 +254,7 @@ MUTATOR_HOOKFUNCTION(ca, reset_map_players)
                {
                        TRANSMUTE(Player, it);
                        it.caplayer = 1;
-                       WITHSELF(it, PutClientInServer());
+                       PutClientInServer(it);
                }
        });
        return true;
index 89740fbc430c5b5c6ee77d80f4a0a5d08912c410..6bbbaee999abca13352a492bcbeae66168dd09aa 100644 (file)
@@ -493,7 +493,7 @@ MUTATOR_HOOKFUNCTION(dom, reset_map_players)
 {
        total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
        FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-               WITHSELF(it, PutClientInServer());
+               PutClientInServer(it);
                if(domination_roundbased)
                        it.player_blocked = 1;
                if(IS_REAL_CLIENT(it))
index 6db1db73d4f6f89276876696a3ea5541057e4c5f..4f8f0fde7bf99406ec137d8df295edacc73c94ee 100644 (file)
@@ -464,7 +464,7 @@ MUTATOR_HOOKFUNCTION(ft, reset_map_players)
        FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
                it.killcount = 0;
                it.freezetag_frozen_timeout = -1;
-               WITHSELF(it, PutClientInServer());
+               PutClientInServer(it);
                it.freezetag_frozen_timeout = 0;
        ));
        freezetag_count_alive_players();
index 61104ebe2fa1a1420d01a20f035ce4ef3fa2b891..9bc0855f5b3c38c82ec67375925c141ad82962a8 100644 (file)
@@ -147,9 +147,9 @@ float playerdemo_read(entity this)
                PLAYERDEMO_FIELDS(this, playerdemo_read_)
                {
                        time = this.playerdemo_time;
-                       WITHSELF(this, PlayerPreThink());
+                       PlayerPreThink(this);
                        // not running physics though... this is just so we can run weapon stuff
-                       WITHSELF(this, PlayerPostThink());
+                       PlayerPostThink(this);
                }
                this.playerdemo_time = stof(fgets(this.playerdemo_fh));
                if(this.playerdemo_time == 0)
index aac9c497d1dabeaf7b901988a098a7128b14ed77..5eaf6618fa865f291018f3a68aa63a62fafbffdb 100644 (file)
@@ -159,7 +159,7 @@ void StartFrame()
 {
     // TODO: if move is more than 50ms, split it into two moves (this matches QWSV behavior and the client prediction)
     FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), PM_Main(it));
-    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), WITHSELF(it, PlayerPreThink()));
+    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), PlayerPreThink(it));
 
        execute_next_frame();
        if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause(true);
@@ -228,7 +228,7 @@ void StartFrame()
        MUTATOR_CALLHOOK(SV_StartFrame);
 
     FOREACH_CLIENT(true, GlobalStats_update(it));
-    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), WITHSELF(it, PlayerPostThink()));
+    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_FAKE_CLIENT(it), PlayerPostThink(it));
 }
 
 .vector originjitter;
@@ -237,8 +237,8 @@ void StartFrame()
 .string gametypefilter;
 .string cvarfilter;
 bool DoesQ3ARemoveThisEntity(entity this);
-void SV_OnEntityPreSpawnFunction()
-{ENGINE_EVENT();
+void SV_OnEntityPreSpawnFunction(entity this)
+{
        __spawnfunc_expecting = true;
        __spawnfunc_expect = this;
        if (this)
index 8709a6aae6b5be4cc0c1c61f54ef71a7a45d292c..3dda784eb3d38bfddb6b68f3fa2abbc2cbe2f8ef 100644 (file)
@@ -559,8 +559,8 @@ int JoinBestTeam(entity this, bool only_return_best, bool forcebestteam)
 }
 
 //void() ctf_playerchanged;
-void SV_ChangeTeam(float _color)
-{ENGINE_EVENT();
+void SV_ChangeTeam(entity this, float _color)
+{
        float scolor, dcolor, steam, dteam; //, dbotcount, scount, dcount;
 
        // in normal deathmatch we can just apply the color and we're done
index c9713984e809a2a1fc49a1c4f7ca61910b0dcdb5..f34c6d59df438b491090956b2e7782153f3f7da3 100644 (file)
@@ -48,6 +48,5 @@ float FindSmallestTeam(entity pl, float ignore_pl);
 int JoinBestTeam(entity this, bool only_return_best, bool forcebestteam);
 
 //void() ctf_playerchanged;
-void SV_ChangeTeam(float _color);
 
 void ShufflePlayerOutOfTeam (float source_team);