From eb8e19d4e9f403c7bf7b694a92b42dbbd06edab0 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 19 Jun 2016 17:42:56 +1000 Subject: [PATCH] Wrap engine events --- qcsrc/client/main.qc | 8 +- qcsrc/client/view.qc | 4 +- .../gamemodes/gamemode/onslaught/onslaught.qc | 2 +- qcsrc/common/physics/player.qc | 5 +- qcsrc/lib/_all.inc | 164 ++++++++++++++++-- qcsrc/server/bot/bot.qc | 4 +- qcsrc/server/bot/scripting.qc | 3 +- qcsrc/server/cl_client.qc | 49 +++--- qcsrc/server/command/cmd.qc | 6 +- qcsrc/server/command/vote.qc | 2 +- qcsrc/server/mutators/mutator/gamemode_ca.qc | 2 +- .../mutators/mutator/gamemode_domination.qc | 2 +- .../mutators/mutator/gamemode_freezetag.qc | 2 +- qcsrc/server/playerdemo.qc | 4 +- qcsrc/server/sv_main.qc | 8 +- qcsrc/server/teamplay.qc | 4 +- qcsrc/server/teamplay.qh | 1 - 17 files changed, 195 insertions(+), 75 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index c62a72e6e..963cc9e41 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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)) { diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 5cb3c18c1..af7eb35b3 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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; diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index 2c5298270..9a30445ac 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@ -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; } diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index d70717ac5..c09601255 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -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); } diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index 03b943625..61755fe94 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -39,28 +39,28 @@ #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 diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index f9afb39d8..8707a03bd 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -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; } diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index 3734ad850..01a1117c9 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -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; } diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 1298ae4fe..608895b4e 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -55,21 +55,20 @@ 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)) diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 2ede443b3..13c883f36 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -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); diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 337b428c5..0aa48c2fe 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -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); } } )); diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index 901a04f2a..2a8da29c2 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -254,7 +254,7 @@ MUTATOR_HOOKFUNCTION(ca, reset_map_players) { TRANSMUTE(Player, it); it.caplayer = 1; - WITHSELF(it, PutClientInServer()); + PutClientInServer(it); } }); return true; diff --git a/qcsrc/server/mutators/mutator/gamemode_domination.qc b/qcsrc/server/mutators/mutator/gamemode_domination.qc index 89740fbc4..6bbbaee99 100644 --- a/qcsrc/server/mutators/mutator/gamemode_domination.qc +++ b/qcsrc/server/mutators/mutator/gamemode_domination.qc @@ -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)) diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index 6db1db73d..4f8f0fde7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -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(); diff --git a/qcsrc/server/playerdemo.qc b/qcsrc/server/playerdemo.qc index 61104ebe2..9bc0855f5 100644 --- a/qcsrc/server/playerdemo.qc +++ b/qcsrc/server/playerdemo.qc @@ -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) diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index aac9c497d..5eaf6618f 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -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) diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 8709a6aae..3dda784eb 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -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 diff --git a/qcsrc/server/teamplay.qh b/qcsrc/server/teamplay.qh index c9713984e..f34c6d59d 100644 --- a/qcsrc/server/teamplay.qh +++ b/qcsrc/server/teamplay.qh @@ -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); -- 2.39.2