X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ft_items.qc;h=213410543961917eea730055a65f123f2060d111;hp=d9bd7bdc9606d8b1399bc89efabede0f952d0c78;hb=65ba38c5228d8af26ac2b04b6e6e536a1772f446;hpb=e42b2d213c9c5fdb4ecd86e792364fdfc1d97853;ds=sidebyside diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index d9bd7bdc96..2134105439 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -825,7 +825,7 @@ bool Item_GiveTo(entity item, entity player) if (item.strength_finished) { pickedup = true; - player.strength_finished = max(player.strength_finished, time) + item.strength_finished; + STAT(STRENGTH_FINISHED, player) = max(STAT(STRENGTH_FINISHED, player), time) + item.strength_finished; } if (item.invincible_finished) { @@ -1708,14 +1708,14 @@ float GiveItems(entity e, float beginarg, float endarg) } } - e.strength_finished = max(0, e.strength_finished - time); + STAT(STRENGTH_FINISHED, e) = max(0, STAT(STRENGTH_FINISHED, e) - time); e.invincible_finished = max(0, e.invincible_finished - time); e.superweapons_finished = max(0, e.superweapons_finished - time); STAT(BUFF_TIME, e) = max(0, STAT(BUFF_TIME, e) - time); PREGIVE(e, items); PREGIVE_WEAPONS(e); - PREGIVE(e, strength_finished); + PREGIVE(e, stat_STRENGTH_FINISHED); PREGIVE(e, invincible_finished); PREGIVE(e, superweapons_finished); PREGIVE_RESOURCE(e, RES_BULLETS); @@ -1756,7 +1756,7 @@ float GiveItems(entity e, float beginarg, float endarg) continue; case "ALL": got += GiveBit(e, items, ITEM_JetpackRegen.m_itemid, op, val); - got += GiveValue(e, strength_finished, op, val); + got += GiveValue(e, stat_STRENGTH_FINISHED, op, val); got += GiveValue(e, invincible_finished, op, val); got += GiveValue(e, superweapons_finished, op, val); got += GiveBit(e, items, IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS, op, val); @@ -1793,7 +1793,7 @@ float GiveItems(entity e, float beginarg, float endarg) got += GiveBit(e, items, ITEM_JetpackRegen.m_itemid, op, val); break; case "strength": - got += GiveValue(e, strength_finished, op, val); + got += GiveValue(e, stat_STRENGTH_FINISHED, op, val); break; case "invincible": got += GiveValue(e, invincible_finished, op, val); @@ -1852,7 +1852,7 @@ float GiveItems(entity e, float beginarg, float endarg) if(STAT(WEAPONS, e) & (it.m_wepset)) it.wr_init(it); }); - POSTGIVE_VALUE(e, strength_finished, 1, SND_POWERUP, SND_POWEROFF); + POSTGIVE_VALUE(e, stat_STRENGTH_FINISHED, 1, SND_POWERUP, SND_POWEROFF); POSTGIVE_VALUE(e, invincible_finished, 1, SND_Shield, SND_POWEROFF); //POSTGIVE_VALUE(e, superweapons_finished, 1, SND_Null, SND_Null); POSTGIVE_RESOURCE(e, RES_BULLETS, 0, SND_ITEMPICKUP, SND_Null); @@ -1868,10 +1868,10 @@ float GiveItems(entity e, float beginarg, float endarg) if(!g_weaponarena && (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS)) e.superweapons_finished = autocvar_g_balance_superweapons_time; - if(e.strength_finished <= 0) - e.strength_finished = 0; + if(STAT(STRENGTH_FINISHED, e) <= 0) + STAT(STRENGTH_FINISHED, e) = 0; else - e.strength_finished += time; + STAT(STRENGTH_FINISHED, e) += time; if(e.invincible_finished <= 0) e.invincible_finished = 0; else