From 95ac8725bb9842a19d2c9c996957d9cbbbacac60 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 9 Jun 2016 21:34:36 +1000 Subject: [PATCH] Fix a few more selfparam's randomly --- qcsrc/common/minigames/cl_minigames.qc | 8 ++++---- qcsrc/common/minigames/minigame/nmm.qc | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/qcsrc/common/minigames/cl_minigames.qc b/qcsrc/common/minigames/cl_minigames.qc index 4e3bfc25d..bff2b0aa1 100644 --- a/qcsrc/common/minigames/cl_minigames.qc +++ b/qcsrc/common/minigames/cl_minigames.qc @@ -160,14 +160,14 @@ string ReadString_Zoned() { return strzone(ReadString_Raw()); } #define MSLE(Name,Fields) \ else if ( this.classname == #Name ) { \ if ( sf & MINIG_SF_CREATE ) { \ - minigame_read_owner(); \ + minigame_read_owner(this); \ this.entremove = msle_entremove_##Name; \ } \ minigame_ent = this.owner; \ Fields \ } -void minigame_read_owner() -{SELFPARAM(); +void minigame_read_owner(entity this) +{ string owner_name = ReadString_Raw(); this.owner = world; do @@ -209,7 +209,7 @@ NET_HANDLE(ENT_CLIENT_MINIGAME, bool isnew) if ( sf & MINIG_SF_CREATE ) { this.entremove = minigame_player_entremove; - minigame_read_owner(); + minigame_read_owner(this); float ent = ReadLong(); this.minigame_playerslot = ent; LOG_DEBUG("Player: ",entcs_GetName(ent-1),"\n"); diff --git a/qcsrc/common/minigames/minigame/nmm.qc b/qcsrc/common/minigames/minigame/nmm.qc index e4e0dc638..2e3ee10d6 100644 --- a/qcsrc/common/minigames/minigame/nmm.qc +++ b/qcsrc/common/minigames/minigame/nmm.qc @@ -618,7 +618,7 @@ string nmm_turn_to_string(int turnflags) // Required function, handle client events int nmm_client_event(entity minigame, string event, ...) -{SELFPARAM(); +{ if ( event == "activate" ) { nmm_fromtile = world; @@ -729,27 +729,29 @@ int nmm_client_event(entity minigame, string event, ...) } else if ( event == "network_receive" ) { - if ( self.classname == "minigame_board_piece" && ( ...(1,int) & MINIG_SF_UPDATE ) ) + entity sent = ...(0,entity); + + if ( sent.classname == "minigame_board_piece" && ( ...(1,int) & MINIG_SF_UPDATE ) ) { entity e; string tileid = ""; - if ( self.minigame_flags & NMM_PIECE_BOARD ) - tileid = minigame_tile_name(self.origin,7,7); + if ( sent.minigame_flags & NMM_PIECE_BOARD ) + tileid = minigame_tile_name(sent.origin,7,7); FOREACH_MINIGAME_ENTITY(e) { if ( e.classname == "minigame_nmm_tile" ) { - if ( e.nmm_tile_piece == self ) + if ( e.nmm_tile_piece == sent ) e.nmm_tile_piece = world; if ( e.netname == tileid ) - e.nmm_tile_piece = self; + e.nmm_tile_piece = sent; } } } - else if ( self.classname == "minigame" && ( ...(1,int) & MINIG_SF_UPDATE ) ) + else if ( sent.classname == "minigame" && ( ...(1,int) & MINIG_SF_UPDATE ) ) { - self.message = nmm_turn_to_string(self.minigame_flags); - if ( self.minigame_flags & minigame_self.team ) + sent.message = nmm_turn_to_string(sent.minigame_flags); + if ( sent.minigame_flags & minigame_self.team ) minigame_prompt(); } } -- 2.39.2