X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fvehicles%2Fsv_vehicles.qc;h=f03e9dc6b4334b8f2fce53e3ffe4e83e49508cf8;hb=9c9254d904b50c3337fa03d065df279ee3e6a738;hp=3ec02901dc14c06435cc35f4d5b738ad940f7add;hpb=2a44628661e48eb9f6ddd26eb6ee38bd6b6755f0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 3ec02901d..f03e9dc6b 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -1,5 +1,7 @@ #include "sv_vehicles.qh" +#include + bool SendAuxiliaryXhair(entity this, entity to, int sf) { WriteHeader(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR); @@ -450,7 +452,7 @@ void vehicles_reset_colors(entity this, entity player) this.velocity = '0 0 0'; this.effects = eff; - Vehicle info = Vehicles_from(this.vehicleid); + Vehicle info = this.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid); info.vr_setcolors(info, this); } @@ -741,7 +743,7 @@ void vehicles_damage(entity this, entity inflictor, entity attacker, float damag antilag_clear(this, this); - Vehicle info = Vehicles_from(this.vehicleid); + Vehicle info = this.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid); info.vr_death(info, this); vehicles_setreturn(this); } @@ -839,6 +841,7 @@ void vehicles_exit(entity vehic, bool eject) WriteByte (MSG_ONE, SVC_SETVIEWPORT); WriteEntity( MSG_ONE, player); + // NOTE: engine networked WriteByte (MSG_ONE, SVC_SETVIEWANGLES); WriteAngle(MSG_ONE, 0); WriteAngle(MSG_ONE, vehic.angles_y); @@ -931,7 +934,7 @@ void vehicles_touch(entity this, entity toucher) } if(this.play_time < time) { - Vehicle info = Vehicles_from(this.vehicleid); + Vehicle info = this.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid); info.vr_impact(info, this); } @@ -976,7 +979,7 @@ void vehicles_enter(entity pl, entity veh) || (pl.vehicle) ) { return; } - Vehicle info = Vehicles_from(veh.vehicleid); + Vehicle info = veh.vehicledef; //REGISTRY_GET(Vehicles, veh.vehicleid); if(autocvar_g_vehicles_enter) // vehicle's touch function should handle this if entering via use key is disabled (TODO) if(veh.vehicle_flags & VHF_MULTISLOT) @@ -1081,6 +1084,7 @@ void vehicles_enter(entity pl, entity veh) WriteByte (MSG_ONE, SVC_SETVIEWPORT); WriteEntity(MSG_ONE, veh.vehicle_viewport); + // NOTE: engine networked WriteByte (MSG_ONE, SVC_SETVIEWANGLES); if(veh.tur_head) { @@ -1115,7 +1119,7 @@ void vehicles_think(entity this) if(this.owner) STAT(VEHICLESTAT_W2MODE, this.owner) = STAT(VEHICLESTAT_W2MODE, this); - Vehicle info = Vehicles_from(this.vehicleid); + Vehicle info = this.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid); info.vr_think(info, this); vehicles_painframe(this); @@ -1188,7 +1192,7 @@ void vehicles_spawn(entity this) }); - Vehicle info = Vehicles_from(this.vehicleid); + Vehicle info = this.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid); info.vr_spawn(info, this); vehicles_reset_colors(this, NULL); @@ -1256,6 +1260,7 @@ bool vehicle_initialize(entity this, Vehicle info, bool nodrop) this.damagedbycontents = true; IL_PUSH(g_damagedbycontents, this); this.vehicleid = info.vehicleid; + this.vehicledef = info; this.PlayerPhysplug = info.PlayerPhysplug; this.event_damage = func_null; this.event_heal = func_null;