player.view_ofs = STAT(PL_VIEW_OFS, player);
player.event_damage = PlayerDamage;
player.hud = HUD_NORMAL;
- PS(player).m_switchweapon = vehic.m_switchweapon;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++ slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ player.(weaponentity).m_switchweapon = vehic.(weaponentity).m_switchweapon;
+ delete(vehic.(weaponentity)); // no longer needed
+ }
player.last_vehiclecheck = time + 3;
player.vehicle_enter_delay = time + 2;
}
else return;
- RemoveGrapplingHook(pl);
+ RemoveGrapplingHooks(pl);
veh.vehicle_ammo1 = 0;
veh.vehicle_ammo2 = 0;
veh.colormap = pl.colormap;
if(veh.tur_head)
veh.tur_head.colormap = pl.colormap;
- veh.m_switchweapon = PS(pl).m_switchweapon;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ veh.(weaponentity) = new(temp_wepent);
+ veh.(weaponentity).m_switchweapon = pl.(weaponentity).m_switchweapon;
+ }
pl.hud = veh.vehicleid;
pl.PlayerPhysplug = veh.PlayerPhysplug;
if(this.vehicle_controller)
this.team = this.vehicle_controller.team;
- FOREACH_CLIENT(IS_PLAYER(it) && it.hook.aiment == this, RemoveGrapplingHook(it));
+ FOREACH_CLIENT(IS_PLAYER(it),
+ {
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ if(it.(weaponentity).hook.aiment == this)
+ RemoveHook(it.(weaponentity).hook);
+ }
+ });
vehicles_reset_colors(this);