#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
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");
// Required function, handle client events
int nmm_client_event(entity minigame, string event, ...)
-{SELFPARAM();
+{
if ( event == "activate" )
{
nmm_fromtile = world;
}
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();
}
}