panel.current_panel_bg,
mySize + '1 1 0' * 2 * panel_bg_border,
panel_bg_color, panel_bg_alpha,
- '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));
+ '1 1 0' * BORDER_MULTIPLIER * panel_bg_border);
drawpic(pos, board_texture, mySize, '1 1 1', panel_bg_alpha, DRAWFLAG_NORMAL);
}
void minigame_autoclean_entity(entity e)
{
- LOG_DEBUG("CL Auto-cleaned: ",ftos(etof(e)), " (",e.classname,")\n");
- remove(e);
+ LOG_DEBUG("CL Auto-cleaned: ",ftos(etof(e)), " (",e.classname,")");
+ delete(e);
}
void HUD_MinigameMenu_CurrentButton();
return;
active_minigame.minigame_event(active_minigame,"deactivate");
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, active_minigame)) )
if ( e.minigame_autoclean )
{
minigame_autoclean_entity(e);
}
- minigame_self = world;
- active_minigame = world;
+ minigame_self = NULL;
+ active_minigame = NULL;
if ( auto_close_minigamemenu )
{
if ( !minigame.descriptor || minigame.classname != "minigame" )
{
- LOG_TRACE("Trying to activate unregistered minigame ",minigame.netname," in client\n");
+ LOG_TRACE("Trying to activate unregistered minigame ",minigame.netname," in client");
return;
}
}
if ( minigame_self.owner != minigame )
- minigame_self = world;
+ minigame_self = NULL;
active_minigame = minigame;
active_minigame.minigame_event(active_minigame,"activate");
#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;
+ this.owner = NULL;
do
this.owner = find(this.owner,netname,owner_name);
while ( this.owner && this.owner.classname != "minigame" );
if ( !this.owner )
- LOG_TRACE("Got a minigame entity without a minigame!\n");
+ LOG_TRACE("Got a minigame entity without a minigame!");
}
NET_HANDLE(ENT_CLIENT_MINIGAME, bool isnew)
{
this.netname = ReadString_Zoned();
}
- entity minigame_ent = world;
+ entity minigame_ent = NULL;
if ( this.classname == "minigame" )
{
this.entremove = minigame_entremove;
this.descriptor = minigame_get_descriptor(ReadString_Raw());
if ( !this.descriptor )
- LOG_TRACE("Got a minigame without a client-side descriptor!\n");
+ LOG_TRACE("Got a minigame without a client-side descriptor!");
else
this.minigame_event = this.descriptor.minigame_event;
}
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");
+ LOG_DEBUG("Player: ",entcs_GetName(ent-1));
activate = (ent == player_localnum+1 && this.owner && this.owner != active_minigame);
{
minigame_self = this;
activate_minigame(this.owner);
+ minigame_self = this; // set it again (needed before, but may also be reset)
}
}
MINIGAME_SIMPLELINKED_ENTITIES
{
LOG_DEBUG("CL Reading entity: ",ftos(etof(this)),
" classname:",this.classname," enttype:",ftos(this.enttype) );
- LOG_DEBUG(" sf:",ftos(sf)," netname:",this.netname,"\n\n");
+ LOG_DEBUG(" sf:",ftos(sf)," netname:",this.netname);
}
return true;
}