From 57f6e5a1c25746fe9cd7b14d6889b99fcbaf6061 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 31 Dec 2017 11:41:26 +1000 Subject: [PATCH] Fix powerups abusing the count field for respawn counters (breaks compatibility with Quake 3 entities) --- qcsrc/common/t_items.qc | 10 +++++----- qcsrc/common/t_items.qh | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index f4431eed2..fa6d0f6f3 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -533,7 +533,7 @@ void Item_Respawn (entity this) void Item_RespawnCountdown (entity this) { - if(this.count >= ITEM_RESPAWN_TICKS) + if(this.item_respawncounter >= ITEM_RESPAWN_TICKS) { if(this.waypointsprite_attached) WaypointSprite_Kill(this.waypointsprite_attached); @@ -542,8 +542,8 @@ void Item_RespawnCountdown (entity this) else { this.nextthink = time + 1; - this.count += 1; - if(this.count == 1) + this.item_respawncounter += 1; + if(this.item_respawncounter == 1) { do { { @@ -584,7 +584,7 @@ void Item_RespawnCountdown (entity this) }); WaypointSprite_Ping(this.waypointsprite_attached); - //WaypointSprite_UpdateHealth(this.waypointsprite_attached, this.count); + //WaypointSprite_UpdateHealth(this.waypointsprite_attached, this.item_respawncounter); } } } @@ -607,7 +607,7 @@ void Item_ScheduleRespawnIn(entity e, float t) setthink(e, Item_RespawnCountdown); e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS); e.scheduledrespawntime = e.nextthink + ITEM_RESPAWN_TICKS; - e.count = 0; + e.item_respawncounter = 0; if(Item_ItemsTime_Allow(e.itemdef) || (e.weapons & WEPSET_SUPERWEAPONS)) { t = Item_ItemsTime_UpdateTime(e, e.scheduledrespawntime); diff --git a/qcsrc/common/t_items.qh b/qcsrc/common/t_items.qh index 5ecbe5488..3740c9a57 100644 --- a/qcsrc/common/t_items.qh +++ b/qcsrc/common/t_items.qh @@ -62,6 +62,8 @@ const float ITEM_RESPAWN_TICKS = 10; .float max_armorvalue; .float pickup_anyway; +.float item_respawncounter; + void Item_Show (entity e, float mode); void Item_Respawn (entity this); -- 2.39.2