Bomb Defusal: fix the bomb not being removed from the game properly upon round ends. Requires a .customphysics fix in upstream Nuclide as well (so update!)
This commit is contained in:
parent
aad8d044e4
commit
c4969943b8
3 changed files with 58 additions and 18 deletions
|
@ -547,6 +547,10 @@ CSMultiplayerRules::RestartRound(int iWipe)
|
|||
dec.m_strTexture = "";
|
||||
dec.SendFlags = -1;
|
||||
}
|
||||
for (entity eFind = world; (eFind = find(eFind, ::classname, "item_c4"));) {
|
||||
NSEntity e = (NSEntity)eFind;
|
||||
e.Destroy();
|
||||
}
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EV_CLEARDECALS);
|
||||
|
|
|
@ -28,17 +28,18 @@ class item_c4:NSRenderableEntity
|
|||
#endif
|
||||
|
||||
#ifdef SERVER
|
||||
void(void) item_c4;
|
||||
virtual float(entity, float) SendEntity;
|
||||
virtual void(void) ClearProgress;
|
||||
virtual void(void) OnPlayerUse;
|
||||
virtual void(void) Logic;
|
||||
void item_c4(void);
|
||||
virtual float SendEntity(entity, float);
|
||||
virtual void ClearProgress(void);
|
||||
virtual void OnPlayerUse(void);
|
||||
virtual void Logic(void);
|
||||
virtual void OnRemoveEntity(void);
|
||||
#endif
|
||||
|
||||
#ifdef CLIENT
|
||||
void(void) item_c4;
|
||||
virtual void(void) DrawLED;
|
||||
virtual float(void) predraw;
|
||||
void item_c4(void);
|
||||
virtual void DrawLED(void);
|
||||
virtual float predraw(void);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -115,20 +116,15 @@ item_c4::Logic(void)
|
|||
}
|
||||
|
||||
if (m_flDefusalState > 10.0f) {
|
||||
ClearProgress();
|
||||
sound(this, CHAN_VOICE, "weapons/c4_disarmed.wav", 1.0, ATTN_NORM);
|
||||
rules.RoundOver(TEAM_CT, 3600, TRUE);
|
||||
Radio_BroadcastMessage(RADIO_BOMBDEF);
|
||||
m_flBeepTime = 0.0f;
|
||||
m_flDefusalState = 0;
|
||||
remove(this);
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
/* if our time has passed, explode */
|
||||
if (m_flExplodeTime < time) {
|
||||
ClearProgress();
|
||||
|
||||
if (m_flExplodeTime < time) {\
|
||||
/* In Bomb Defusal, all Terrorists receive $3500
|
||||
* if they won by detonating the bomb. */
|
||||
rules.RoundOver(TEAM_T, 3500, FALSE);
|
||||
|
@ -142,9 +138,7 @@ item_c4::Logic(void)
|
|||
}
|
||||
}
|
||||
|
||||
m_flBeepTime = 0.0f;
|
||||
m_flDefusalState = 0;
|
||||
remove(this);
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -168,6 +162,14 @@ item_c4::Logic(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
item_c4::OnRemoveEntity(void)
|
||||
{
|
||||
ClearProgress();
|
||||
m_flBeepTime = 0.0f;
|
||||
m_flDefusalState = 0;
|
||||
}
|
||||
|
||||
void
|
||||
item_c4::item_c4(void)
|
||||
{
|
||||
|
|
|
@ -181,6 +181,7 @@ class player:NSClientPlayer
|
|||
virtual void ReceiveEntity(float, float);
|
||||
virtual void PredictPreFrame(void);
|
||||
virtual void PredictPostFrame(void);
|
||||
virtual void UpdateAliveCam(void);
|
||||
#else
|
||||
virtual void ServerInputFrame(void);
|
||||
virtual void EvaluateEntity(void);
|
||||
|
@ -226,6 +227,39 @@ player::UpdatePlayerAnimation(float timelength)
|
|||
}
|
||||
|
||||
#ifdef CLIENT
|
||||
void Camera_RunPosBob(vector angles, __inout vector camera_pos);
|
||||
void Camera_StrafeRoll(__inout vector camera_angle);
|
||||
void Shake_Update(NSClientPlayer);
|
||||
|
||||
void
|
||||
player::UpdateAliveCam(void)
|
||||
{
|
||||
vector cam_pos = GetEyePos();
|
||||
Camera_RunPosBob(view_angles, cam_pos);
|
||||
|
||||
g_view.SetCameraOrigin(cam_pos);
|
||||
Camera_StrafeRoll(view_angles);
|
||||
g_view.SetCameraAngle(view_angles);
|
||||
|
||||
if (vehicle) {
|
||||
NSVehicle veh = (NSVehicle)vehicle;
|
||||
|
||||
if (veh.UpdateView)
|
||||
veh.UpdateView();
|
||||
} else if (health) {
|
||||
if (autocvar_pm_thirdPerson == TRUE) {
|
||||
makevectors(view_angles);
|
||||
vector vStart = [pSeat->m_vecPredictedOrigin[0], pSeat->m_vecPredictedOrigin[1], pSeat->m_vecPredictedOrigin[2] + 16] + (v_right * 4);
|
||||
vector vEnd = vStart + (v_forward * -48) + [0,0,16] + (v_right * 4);
|
||||
traceline(vStart, vEnd, FALSE, this);
|
||||
g_view.SetCameraOrigin(trace_endpos + (v_forward * 5));
|
||||
}
|
||||
}
|
||||
|
||||
Shake_Update(this);
|
||||
g_view.AddPunchAngle(punchangle);
|
||||
}
|
||||
|
||||
.string oldmodel;
|
||||
string Weapons_GetPlayermodel(player, int);
|
||||
|
||||
|
|
Loading…
Reference in a new issue