#ifdef IMPLEMENTATION
#ifdef SVQC
-.float metertime;
+.float metertime = _STAT(NB_METERSTART);
int autocvar_g_nexball_goalleadlimit;
#define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
GameLogEcho(s);
}
-void ball_restart()
-{SELFPARAM();
- if(self.owner)
- DropBall(self, self.owner.origin, '0 0 0');
+void ball_restart(entity this)
+{
+ if(this.owner)
+ DropBall(this, this.owner.origin, '0 0 0');
ResetBall();
}
}
plyr.(weaponentity).weapons = plyr.weapons;
- plyr.(weaponentity).switchweapon = plyr.weapon;
+ plyr.(weaponentity).m_switchweapon = Weapons_from(plyr.weapon);
plyr.weapons = WEPSET(NEXBALL);
setself(plyr);
Weapon w = WEP_NEXBALL;
w.wr_resetplayer(w);
- plyr.switchweapon = WEP_NEXBALL.m_id;
- W_SwitchWeapon(WEP_NEXBALL.m_id);
+ PS(plyr).m_switchweapon = WEP_NEXBALL;
+ W_SwitchWeapon(WEP_NEXBALL);
setself(this);
}
W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
missile.angles = vectoangles(missile.velocity);
missile.touch = W_Nexball_Touch;
- missile.think = SUB_Remove;
+ missile.think = SUB_Remove_self;
missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
self.weapons = self.(weaponentity).weapons;
Weapon w = WEP_NEXBALL;
w.wr_resetplayer(w);
- self.switchweapon = self.(weaponentity).switchweapon;
- W_SwitchWeapon(self.switchweapon);
+ PS(self).m_switchweapon = self.(weaponentity).m_switchweapon;
+ W_SwitchWeapon(PS(self).m_switchweapon);
self.(weaponentity).weapons = '0 0 0';
}
if(g_nexball_meter_period <= 0)
g_nexball_meter_period = 2; // avoid division by zero etc. due to silly users
g_nexball_meter_period = rint(g_nexball_meter_period * 32) / 32; //Round to 1/32ths to send as a byte multiplied by 32
- addstat(STAT_NB_METERSTART, AS_FLOAT, metertime);
// General settings
/*