]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Purge SetResourceAmountExplicit 636/head
authorMario <mario@smbclan.net>
Sun, 3 Feb 2019 01:14:25 +0000 (11:14 +1000)
committerMario <mario@smbclan.net>
Sun, 3 Feb 2019 01:14:25 +0000 (11:14 +1000)
63 files changed:
qcsrc/client/resources.qc
qcsrc/client/resources.qh
qcsrc/client/shownames.qc
qcsrc/common/ent_cs.qc
qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/items/item/ammo.qh
qcsrc/common/items/item/armor.qh
qcsrc/common/items/item/health.qh
qcsrc/common/items/item/jetpack.qh
qcsrc/common/mapobjects/func/breakable.qc
qcsrc/common/mapobjects/func/button.qc
qcsrc/common/mapobjects/func/door.qc
qcsrc/common/mapobjects/func/door_rotating.qc
qcsrc/common/mapobjects/func/door_secret.qc
qcsrc/common/mapobjects/trigger/heal.qc
qcsrc/common/mapobjects/trigger/multi.qc
qcsrc/common/mapobjects/trigger/secret.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/monsters/monster/zombie.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/instagib/items.qh
qcsrc/common/mutators/mutator/invincibleproj/sv_invincibleproj.qc
qcsrc/common/mutators/mutator/nades/net.qc
qcsrc/common/mutators/mutator/overkill/okrpc.qc
qcsrc/common/mutators/mutator/vampirehook/sv_vampirehook.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/server/cheats.qc
qcsrc/server/client.qc
qcsrc/server/compat/quake3.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_world.qc
qcsrc/server/mapvoting.qc
qcsrc/server/player.qc
qcsrc/server/portals.qc
qcsrc/server/resources.qc
qcsrc/server/resources.qh

index 285ebad639c4ea4f66cdfeeb2394280f5e711d32..3685e9ac81ae984ebd94035577161427dfe1449c 100644 (file)
@@ -11,20 +11,10 @@ float GetResourceAmount(entity e, int resource_type)
        return e.(resource_field);
 }
 
-bool SetResourceAmountExplicit(entity e, int resource_type, float amount)
-{
-       .float resource_field = GetResourceField(resource_type);
-       if (e.(resource_field) != amount)
-       {
-               e.(resource_field) = amount;
-               return true;
-       }
-       return false;
-}
-
 void SetResourceAmount(entity e, int resource_type, float amount)
 {
-       SetResourceAmountExplicit(e, resource_type, amount);
+       .float resource_field = GetResourceField(resource_type);
+       e.(resource_field) = amount;
 }
 
 void TakeResource(entity receiver, int resource_type, float amount)
index 3aaa8aab593786ffd7b15f46909258899f6f7772..4f57a2f3c01524fb13595f9a0818720bc17877d1 100644 (file)
 /// \return Current amount of resource the given entity has.
 float GetResourceAmount(entity e, int resource_type);
 
-/// \brief Sets the resource amount of an entity without calling any hooks.
-/// \param[in,out] e Entity to adjust.
-/// \param[in] resource_type Type of the resource (a RESOURCE_* constant).
-/// \param[in] amount Amount of resource to set.
-/// \return Boolean for whether the ammo amount was changed
-bool SetResourceAmountExplicit(entity e, int resource_type, float amount);
-
 /// \brief Sets the current amount of resource the given entity will have.
 /// \param[in,out] e Entity to adjust.
 /// \param[in] resource_type Type of the resource (a RESOURCE_* constant).
index 53e7ae4a9181b56d186368b3eeb7532dae3ea9b6..994ec72e48deb44d48528c0d9d9db41628b6eb9b 100644 (file)
@@ -206,13 +206,13 @@ void Draw_ShowNames_All()
                if (entcs.m_entcs_private)
                {
                        it.healthvalue = entcs.healthvalue;
-                       SetResourceAmountExplicit(it, RESOURCE_ARMOR, GetResourceAmount(entcs, RESOURCE_ARMOR));
+                       SetResourceAmount(it, RESOURCE_ARMOR, GetResourceAmount(entcs, RESOURCE_ARMOR));
                        it.sameteam = true;
                }
                else
                {
                        it.healthvalue = 0;
-                       SetResourceAmountExplicit(it, RESOURCE_ARMOR, 0);
+                       SetResourceAmount(it, RESOURCE_ARMOR, 0);
                        it.sameteam = false;
                }
                bool dead = entcs_IsDead(i) || entcs_IsSpectating(i);
index a15ebc2966323ac468d95c9e910036d5d58b0687..0c430e26cdb4eb677486070f70dee195af5ab6f3 100644 (file)
@@ -77,7 +77,7 @@ void entcs_force_origin(entity player)
        bool id##_check(entity ent, entity player) { \
                return (floor(GetResourceAmount(ent, checkprop) / decfactor) != floor(GetResourceAmount(player, checkprop) / decfactor)); \
        } \
-       void id##_set(entity ent, entity player) { SetResourceAmountExplicit(ent, checkprop, GetResourceAmount(player, checkprop)); } \
+       void id##_set(entity ent, entity player) { SetResourceAmount(ent, checkprop, GetResourceAmount(player, checkprop)); } \
        void id##_send(int chan, entity ent) { LAMBDA(svsend); } \
        REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) { \
                this.m_public = ispublic; \
@@ -123,7 +123,7 @@ ENTCS_PROP_RESOURCE(HEALTH, false, RESOURCE_HEALTH, ENTCS_SET_NORMAL, DEC_FACTOR
 
 ENTCS_PROP_RESOURCE(ARMOR, false, RESOURCE_ARMOR, ENTCS_SET_NORMAL, DEC_FACTOR,
        { WriteByte(chan, bound(0, GetResourceAmount(ent, RESOURCE_ARMOR) / DEC_FACTOR, 255)); },
-       { SetResourceAmountExplicit(ent, RESOURCE_ARMOR, ReadByte() * DEC_FACTOR); })
+       { SetResourceAmount(ent, RESOURCE_ARMOR, ReadByte() * DEC_FACTOR); })
 #undef DEC_FACTOR
 
 ENTCS_PROP(NAME, true, netname, ENTCS_SET_MUTABLE_STRING,
index 95dd412f49b92be2d946e0ea8e7f4e61b0bfb37c..c3ef2db96f1fb551c87f3f0659cf3d821a37f2fe 100644 (file)
@@ -17,7 +17,7 @@ STATIC_INIT(g_assault)
 void assault_objective_use(entity this, entity actor, entity trigger)
 {
        // activate objective
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 100);
+       SetResourceAmount(this, RESOURCE_HEALTH, 100);
        //print("^2Activated objective ", this.targetname, "=", etos(this), "\n");
        //print("Activator is ", actor.classname, "\n");
 
@@ -39,7 +39,7 @@ vector target_objective_spawn_evalfunc(entity this, entity player, entity spot,
 // and when a new round starts
 void assault_objective_reset(entity this)
 {
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, ASSAULT_VALUE_INACTIVE);
+       SetResourceAmount(this, RESOURCE_HEALTH, ASSAULT_VALUE_INACTIVE);
 }
 
 // decrease the health of targeted objectives
@@ -72,7 +72,7 @@ void assault_objective_decrease_use(entity this, entity actor, entity trigger)
                {
                        GameRules_scoring_add_team(actor, SCORE, hlth);
                        GameRules_scoring_add_team(actor, ASSAULT_OBJECTIVES, 1);
-                       SetResourceAmountExplicit(this.enemy, RESOURCE_HEALTH, -1);
+                       SetResourceAmount(this.enemy, RESOURCE_HEALTH, -1);
 
                        if(this.enemy.message)
                                FOREACH_CLIENT(IS_PLAYER(it), { centerprint(it, this.enemy.message); });
@@ -323,7 +323,7 @@ spawnfunc(target_objective_decrease)
                this.dmg = 101;
 
        this.use = assault_objective_decrease_use;
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, ASSAULT_VALUE_INACTIVE);
+       SetResourceAmount(this, RESOURCE_HEALTH, ASSAULT_VALUE_INACTIVE);
        this.max_health = ASSAULT_VALUE_INACTIVE;
        this.enemy = NULL;
 
index fb744e443b9097cd1872db093232c3213015e37a..09a46312305e5c8563b5eeb1c9315d1c458ade4a 100644 (file)
@@ -341,7 +341,7 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype)
        set_movetype(flag, MOVETYPE_TOSS);
        flag.takedamage = DAMAGE_YES;
        flag.angles = '0 0 0';
-       SetResourceAmountExplicit(flag, RESOURCE_HEALTH, flag.max_flag_health);
+       SetResourceAmount(flag, RESOURCE_HEALTH, flag.max_flag_health);
        flag.ctf_droptime = time;
        flag.ctf_dropper = player;
        flag.ctf_status = FLAG_DROPPED;
@@ -679,7 +679,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
        switch(pickuptype)
        {
                case PICKUP_BASE: flag.ctf_pickuptime = time; break; // used for timing runs
-               case PICKUP_DROPPED: SetResourceAmountExplicit(flag, RESOURCE_HEALTH, flag.max_flag_health); break; // reset health/return timelimit
+               case PICKUP_DROPPED: SetResourceAmount(flag, RESOURCE_HEALTH, flag.max_flag_health); break; // reset health/return timelimit
                default: break;
        }
 
@@ -876,7 +876,7 @@ void ctf_FlagDamage(entity this, entity inflictor, entity attacker, float damage
                        this.ctf_flagdamaged_byworld = true;
                else
                {
-                       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 0);
+                       SetResourceAmount(this, RESOURCE_HEALTH, 0);
                        ctf_CheckFlagReturn(this, RETURN_NEEDKILL);
                }
                return;
@@ -947,7 +947,7 @@ void ctf_FlagThink(entity this)
                        {
                                if((vdist(this.origin - this.ctf_spawnorigin, <=, autocvar_g_ctf_flag_return_dropped)) || (autocvar_g_ctf_flag_return_dropped == -1))
                                {
-                                       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 0);
+                                       SetResourceAmount(this, RESOURCE_HEALTH, 0);
                                        ctf_CheckFlagReturn(this, RETURN_DROPPED);
                                        return;
                                }
@@ -971,7 +971,7 @@ void ctf_FlagThink(entity this)
                {
                        if(this.speedrunning && ctf_captimerecord && (time >= this.ctf_pickuptime + ctf_captimerecord))
                        {
-                               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 0);
+                               SetResourceAmount(this, RESOURCE_HEALTH, 0);
                                ctf_CheckFlagReturn(this, RETURN_SPEEDRUN);
 
                                CS(this.owner).impulse = CHIMPULSE_SPEEDRUN.impulse; // move the player back to the waypoint they set
@@ -1040,7 +1040,7 @@ METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher))
        {
                if(!autocvar_g_ctf_flag_return_damage_delay)
                {
-                       SetResourceAmountExplicit(flag, RESOURCE_HEALTH, 0);
+                       SetResourceAmount(flag, RESOURCE_HEALTH, 0);
                        ctf_CheckFlagReturn(flag, RETURN_NEEDKILL);
                }
                if(!flag.ctf_flagdamaged_byworld) { return; }
@@ -1164,7 +1164,7 @@ void ctf_RespawnFlag(entity flag)
 
        set_movetype(flag, ((flag.noalign) ? MOVETYPE_NONE : MOVETYPE_TOSS));
        flag.takedamage = DAMAGE_NO;
-       SetResourceAmountExplicit(flag, RESOURCE_HEALTH, flag.max_flag_health);
+       SetResourceAmount(flag, RESOURCE_HEALTH, flag.max_flag_health);
        flag.solid = SOLID_TRIGGER;
        flag.velocity = '0 0 0';
        flag.angles = flag.mangle;
@@ -1251,7 +1251,7 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e
        flag.takedamage = DAMAGE_NO;
        flag.damageforcescale = autocvar_g_ctf_flag_damageforcescale;
        flag.max_flag_health = ((autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health) ? autocvar_g_ctf_flag_health : 100);
-       SetResourceAmountExplicit(flag, RESOURCE_HEALTH, flag.max_flag_health);
+       SetResourceAmount(flag, RESOURCE_HEALTH, flag.max_flag_health);
        flag.event_damage = ctf_FlagDamage;
        flag.pushable = true;
        flag.teleportable = TELEPORT_NORMAL;
index 11c55d66794761b667d67983634fa5e3bae72e59..0fae48b72b3ff2e7c7d031cba08fea1a4bc3ddb9 100644 (file)
@@ -330,7 +330,7 @@ void ft_RemovePlayer(entity this)
                freezetag_LastPlayerForTeam_Notify(this);
        Unfreeze(this, false);
 
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 0); // neccessary to correctly count alive players
+       SetResourceAmount(this, RESOURCE_HEALTH, 0); // neccessary to correctly count alive players
        freezetag_count_alive_players();
 }
 
@@ -502,7 +502,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
                if (STAT(FROZEN, player) == FROZEN_NORMAL)
                {
                        STAT(REVIVE_PROGRESS, player) = bound(0, STAT(REVIVE_PROGRESS, player) - frametime * autocvar_g_freezetag_revive_clearspeed, 1);
-                       SetResourceAmountExplicit(player, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, player) * ((warmup_stage) ? warmup_start_health : start_health)));
+                       SetResourceAmount(player, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, player) * ((warmup_stage) ? warmup_start_health : start_health)));
                }
                else if (!STAT(FROZEN, player))
                        STAT(REVIVE_PROGRESS, player) = 0; // thawing nobody
@@ -510,7 +510,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
        else if (STAT(FROZEN, player) == FROZEN_NORMAL) // OK, there is at least one teammate reviving us
        {
                STAT(REVIVE_PROGRESS, player) = bound(0, STAT(REVIVE_PROGRESS, player) + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
-               SetResourceAmountExplicit(player, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, player) * ((warmup_stage) ? warmup_start_health : start_health)));
+               SetResourceAmount(player, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, player) * ((warmup_stage) ? warmup_start_health : start_health)));
 
                if(STAT(REVIVE_PROGRESS, player) >= 1)
                {
index b8d49b10f2edce3580b517f2556a95f35fd092f7..2ae142fe14c23702bf4c1646d2184a39a1168ca6 100644 (file)
@@ -165,7 +165,7 @@ NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew)
                this.origin = ReadVector();
                setorigin(this, this.origin);
 
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, ReadByte());
+               SetResourceAmount(this, RESOURCE_HEALTH, ReadByte());
                this.max_health = ReadByte();
                this.count = ReadByte();
                this.team = ReadByte();
@@ -192,6 +192,6 @@ NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew)
                if(_tmp != GetResourceAmount(this, RESOURCE_HEALTH))
                        cpicon_damage(this, _tmp);
 
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, _tmp);
+               SetResourceAmount(this, RESOURCE_HEALTH, _tmp);
        }
 }
index 9d12c5548e6d4eafd4abdb336b6aa7208274bda3..ef2b10d0502462c29d4ca9bbfa2c6c028f894f83 100644 (file)
@@ -195,7 +195,7 @@ NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew)
                this.origin = ReadVector();
                setorigin(this, this.origin);
 
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, ReadByte());
+               SetResourceAmount(this, RESOURCE_HEALTH, ReadByte());
                this.max_health = ReadByte();
                this.count = ReadByte();
                this.team = ReadByte();
@@ -222,6 +222,6 @@ NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew)
                if(_tmp != GetResourceAmount(this, RESOURCE_HEALTH))
                        generator_damage(this, _tmp);
 
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, _tmp);
+               SetResourceAmount(this, RESOURCE_HEALTH, _tmp);
        }
 }
index 6ac6c7c4bd29d25dc009b154874764e93773839a..dc591d7398d20085fe7c34e3f35ee37f690a4dca 100644 (file)
@@ -540,7 +540,7 @@ void ons_ControlPoint_Icon_BuildThink(entity this)
 
        if (GetResourceAmount(this, RESOURCE_HEALTH) >= this.max_health)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
                this.count = autocvar_g_onslaught_cp_regen * ONS_CP_THINKRATE; // slow repair rate from now on
                setthink(this, ons_ControlPoint_Icon_Think);
                sound(this, CH_TRIGGER, SND_ONS_CONTROLPOINT_BUILT, VOL_BASE, ATTEN_NORM);
@@ -588,7 +588,7 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player)
 
        e.owner = cp;
        e.max_health = autocvar_g_onslaught_cp_health;
-       SetResourceAmountExplicit(e, RESOURCE_HEALTH, autocvar_g_onslaught_cp_buildhealth);
+       SetResourceAmount(e, RESOURCE_HEALTH, autocvar_g_onslaught_cp_buildhealth);
        e.solid = SOLID_NOT;
        e.takedamage = DAMAGE_AIM;
        e.bot_attack = true;
@@ -998,7 +998,7 @@ void ons_GeneratorThink(entity this)
 void ons_GeneratorReset(entity this)
 {
        this.team = this.team_saved;
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, autocvar_g_onslaught_gen_health);
+       SetResourceAmount(this, RESOURCE_HEALTH, autocvar_g_onslaught_gen_health);
        this.lasthealth = this.max_health = autocvar_g_onslaught_gen_health;
        this.takedamage = DAMAGE_AIM;
        this.bot_attack = true;
@@ -1066,7 +1066,7 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o
        IL_PUSH(g_saved_team, gen);
        set_movetype(gen, MOVETYPE_NONE);
        gen.lasthealth = gen.max_health = autocvar_g_onslaught_gen_health;
-       SetResourceAmountExplicit(gen, RESOURCE_HEALTH, autocvar_g_onslaught_gen_health);
+       SetResourceAmount(gen, RESOURCE_HEALTH, autocvar_g_onslaught_gen_health);
        gen.takedamage = DAMAGE_AIM;
        gen.bot_attack = true;
        IL_PUSH(g_bot_targets, gen);
index 51480b453644e28ac2c5d2d427dedc52506a09e6..d3f1573b2145d770e594530eb375fedba0f944df 100644 (file)
@@ -49,7 +49,7 @@ PROPERTY(int, g_pickup_nails);
 void ammo_bullets_init(Pickup this, entity item)
 {
     if(!GetResourceAmount(item, RESOURCE_BULLETS))
-        SetResourceAmountExplicit(item, RESOURCE_BULLETS, g_pickup_nails);
+        SetResourceAmount(item, RESOURCE_BULLETS, g_pickup_nails);
 }
 #endif
 
@@ -83,7 +83,7 @@ PROPERTY(int, g_pickup_cells);
 void ammo_cells_init(Pickup this, entity item)
 {
     if(!GetResourceAmount(item, RESOURCE_CELLS))
-        SetResourceAmountExplicit(item, RESOURCE_CELLS, g_pickup_cells);
+        SetResourceAmount(item, RESOURCE_CELLS, g_pickup_cells);
 }
 #endif
 REGISTER_ITEM(Cells, Ammo) {
@@ -113,7 +113,7 @@ PROPERTY(int, g_pickup_plasma);
 void ammo_plasma_init(Pickup this, entity item)
 {
     if(!GetResourceAmount(item, RESOURCE_PLASMA))
-        SetResourceAmountExplicit(item, RESOURCE_PLASMA, g_pickup_plasma);
+        SetResourceAmount(item, RESOURCE_PLASMA, g_pickup_plasma);
 }
 #endif
 REGISTER_ITEM(Plasma, Ammo) {
@@ -143,7 +143,7 @@ PROPERTY(int, g_pickup_rockets);
 void ammo_rockets_init(Pickup this, entity item)
 {
     if(!GetResourceAmount(item, RESOURCE_ROCKETS))
-        SetResourceAmountExplicit(item, RESOURCE_ROCKETS, g_pickup_rockets);
+        SetResourceAmount(item, RESOURCE_ROCKETS, g_pickup_rockets);
 }
 #endif
 REGISTER_ITEM(Rockets, Ammo) {
@@ -173,7 +173,7 @@ PROPERTY(int, g_pickup_shells);
 void ammo_shells_init(Pickup this, entity item)
 {
     if(!GetResourceAmount(item, RESOURCE_SHELLS))
-        SetResourceAmountExplicit(item, RESOURCE_SHELLS, g_pickup_shells);
+        SetResourceAmount(item, RESOURCE_SHELLS, g_pickup_shells);
 }
 #endif
 
index 2ecd8355714c950f1089cc7d03bbcbc1c8a2850a..2889f9224880b18243f142d69aaf8c1b770c3d54 100644 (file)
@@ -27,7 +27,7 @@ void item_armorsmall_init(Pickup this, entity item)
     if(!item.max_armorvalue)
         item.max_armorvalue = g_pickup_armorsmall_max;
     if(!GetResourceAmount(item, RESOURCE_ARMOR))
-        SetResourceAmountExplicit(item, RESOURCE_ARMOR, g_pickup_armorsmall);
+        SetResourceAmount(item, RESOURCE_ARMOR, g_pickup_armorsmall);
 }
 #endif
 
@@ -65,7 +65,7 @@ void item_armormedium_init(Pickup this, entity item)
     if(!item.max_armorvalue)
         item.max_armorvalue = g_pickup_armormedium_max;
     if(!GetResourceAmount(item, RESOURCE_ARMOR))
-        SetResourceAmountExplicit(item, RESOURCE_ARMOR, g_pickup_armormedium);
+        SetResourceAmount(item, RESOURCE_ARMOR, g_pickup_armormedium);
 }
 #endif
 
@@ -103,7 +103,7 @@ void item_armorbig_init(Pickup this, entity item)
     if(!item.max_armorvalue)
         item.max_armorvalue = g_pickup_armorbig_max;
     if(!GetResourceAmount(item, RESOURCE_ARMOR))
-        SetResourceAmountExplicit(item, RESOURCE_ARMOR, g_pickup_armorbig);
+        SetResourceAmount(item, RESOURCE_ARMOR, g_pickup_armorbig);
 }
 #endif
 
@@ -143,7 +143,7 @@ void item_armormega_init(Pickup this, entity item)
     if(!item.max_armorvalue)
         item.max_armorvalue = g_pickup_armormega_max;
     if(!GetResourceAmount(item, RESOURCE_ARMOR))
-        SetResourceAmountExplicit(item, RESOURCE_ARMOR, g_pickup_armormega);
+        SetResourceAmount(item, RESOURCE_ARMOR, g_pickup_armormega);
 }
 #endif
 
index e6a9dd9883589f13776384d823e207beae250357..a7dd3c370fd513a76a4432304808144730ee07fa 100644 (file)
@@ -27,7 +27,7 @@ void item_healthsmall_init(Pickup this, entity item)
     if(!item.max_health)
         item.max_health = g_pickup_healthsmall_max;
     if(!GetResourceAmount(item, RESOURCE_HEALTH))
-        SetResourceAmountExplicit(item, RESOURCE_HEALTH, g_pickup_healthsmall);
+        SetResourceAmount(item, RESOURCE_HEALTH, g_pickup_healthsmall);
 }
 #endif
 
@@ -65,7 +65,7 @@ void item_healthmedium_init(Pickup this, entity item)
     if(!item.max_health)
         item.max_health = g_pickup_healthmedium_max;
     if(!GetResourceAmount(item, RESOURCE_HEALTH))
-        SetResourceAmountExplicit(item, RESOURCE_HEALTH, g_pickup_healthmedium);
+        SetResourceAmount(item, RESOURCE_HEALTH, g_pickup_healthmedium);
 }
 #endif
 
@@ -103,7 +103,7 @@ void item_healthbig_init(Pickup this, entity item)
     if(!item.max_health)
         item.max_health = g_pickup_healthbig_max;
     if(!GetResourceAmount(item, RESOURCE_HEALTH))
-        SetResourceAmountExplicit(item, RESOURCE_HEALTH, g_pickup_healthbig);
+        SetResourceAmount(item, RESOURCE_HEALTH, g_pickup_healthbig);
 }
 #endif
 
@@ -143,7 +143,7 @@ void item_healthmega_init(Pickup this, entity item)
     if(!item.max_health)
         item.max_health = g_pickup_healthmega_max;
     if(!GetResourceAmount(item, RESOURCE_HEALTH))
-        SetResourceAmountExplicit(item, RESOURCE_HEALTH, g_pickup_healthmega);
+        SetResourceAmount(item, RESOURCE_HEALTH, g_pickup_healthmega);
 }
 #endif
 
index 24d040d56b403753c50f12f4ddcee7869a7f9cff..f33e62cb3474bfb5c26f7467ffc0304169d4a245 100644 (file)
@@ -20,7 +20,7 @@ PROPERTY(int, g_pickup_fuel_jetpack);
 void powerup_jetpack_init(Pickup this, entity item)
 {
     if(!GetResourceAmount(item, RESOURCE_FUEL))
-        SetResourceAmountExplicit(item, RESOURCE_FUEL, g_pickup_fuel_jetpack);
+        SetResourceAmount(item, RESOURCE_FUEL, g_pickup_fuel_jetpack);
 }
 #endif
 
@@ -58,7 +58,7 @@ PROPERTY(int, g_pickup_fuel);
 void ammo_fuel_init(Pickup this, entity item)
 {
     if(!GetResourceAmount(item, RESOURCE_FUEL))
-        SetResourceAmountExplicit(item, RESOURCE_FUEL, g_pickup_fuel);
+        SetResourceAmount(item, RESOURCE_FUEL, g_pickup_fuel);
 }
 #endif
 REGISTER_ITEM(JetpackFuel, Ammo) {
index cb17ac442cb4244aa71b708e6c7c27deaf220bb4..b3a93d9c90ea3045a34ed6150548100252cec492 100644 (file)
@@ -129,7 +129,7 @@ void func_breakable_look_restore(entity this)
 
 void func_breakable_behave_destroyed(entity this)
 {
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+       SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        this.takedamage = DAMAGE_NO;
        if(this.bot_attack)
                IL_REMOVE(g_bot_targets, this);
@@ -157,7 +157,7 @@ void func_breakable_think(entity this)
 void func_breakable_destroy(entity this, entity actor, entity trigger);
 void func_breakable_behave_restore(entity this)
 {
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+       SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        if(this.sprite)
        {
                WaypointSprite_UpdateMaxHealth(this.sprite, this.max_health);
@@ -316,7 +316,7 @@ spawnfunc(func_breakable)
 {
        float n, i;
        if(!GetResourceAmount(this, RESOURCE_HEALTH))
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 100);
+               SetResourceAmount(this, RESOURCE_HEALTH, 100);
        this.max_health = GetResourceAmount(this, RESOURCE_HEALTH);
 
        // yes, I know, MOVETYPE_NONE is not available here, not that one would want it here anyway
index 024d5cfd873cfb37d288785876d4e4c0684a681f..4dc55fccf49b3f484c0980dd10e7f20ee64630dc 100644 (file)
@@ -83,7 +83,7 @@ void button_blocked(entity this, entity blocker)
 
 void button_fire(entity this)
 {
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+       SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        this.takedamage = DAMAGE_NO;    // will be reset upon return
 
        if (this.state == STATE_UP || this.state == STATE_TOP)
@@ -100,7 +100,7 @@ void button_fire(entity this)
 
 void button_reset(entity this)
 {
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+       SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        setorigin(this, this.pos1);
        this.frame = 0;                 // use normal textures
        this.state = STATE_BOTTOM;
index 1ba7bad3aa633a12556f1476ad5f5efb78eb471b..3aaf047a31a9b59e38c5aaeedc583c6a7097f7c8 100644 (file)
@@ -113,7 +113,7 @@ void door_go_down(entity this)
        if (this.max_health)
        {
                this.takedamage = DAMAGE_YES;
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        }
 
        this.state = STATE_DOWN;
@@ -275,7 +275,7 @@ void door_damage(entity this, entity inflictor, entity attacker, float damage, i
 
        if (GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
        {
-               SetResourceAmountExplicit(this.owner, RESOURCE_HEALTH, this.owner.max_health);
+               SetResourceAmount(this.owner, RESOURCE_HEALTH, this.owner.max_health);
                this.owner.takedamage = DAMAGE_NO;      // will be reset upon return
                door_use(this.owner, attacker, NULL);
        }
@@ -475,7 +475,7 @@ void LinkDoors(entity this)
        for(t = this; ; t = t.enemy)
        {
                if(GetResourceAmount(t, RESOURCE_HEALTH) && !GetResourceAmount(this, RESOURCE_HEALTH))
-                       SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(t, RESOURCE_HEALTH));
+                       SetResourceAmount(this, RESOURCE_HEALTH, GetResourceAmount(t, RESOURCE_HEALTH));
                if((t.targetname != "") && (this.targetname == ""))
                        this.targetname = t.targetname;
                if((t.message != "") && (this.message == ""))
@@ -499,7 +499,7 @@ void LinkDoors(entity this)
        // distribute health, targetname, message
        for(t = this; t; t = t.enemy)
        {
-               SetResourceAmountExplicit(t, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
+               SetResourceAmount(t, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
                t.targetname = this.targetname;
                t.message = this.message;
                if(t.enemy == this)
index 39c02a8669881528f5a57d792c921fe03530c890..a36bc3e4da3915a159bb8d4191a0e6abb0e67df7 100644 (file)
@@ -58,7 +58,7 @@ void door_rotating_go_down(entity this)
        if (this.max_health)
        {
                this.takedamage = DAMAGE_YES;
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        }
 
        this.state = STATE_DOWN;
index f06f39e91126e963fa507e139a19304bfbcb6453..7751092b58cc114bec56c58f59d5d2ec280b4234 100644 (file)
@@ -13,7 +13,7 @@ void fd_secret_use(entity this, entity actor, entity trigger)
        float temp;
        string message_save;
 
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10000);
+       SetResourceAmount(this, RESOURCE_HEALTH, 10000);
        if(!this.bot_attack)
                IL_PUSH(g_bot_targets, this);
        this.bot_attack = true;
@@ -122,7 +122,7 @@ void fd_secret_done(entity this)
 {
        if (this.spawnflags&DOOR_SECRET_YES_SHOOT)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10000);
+               SetResourceAmount(this, RESOURCE_HEALTH, 10000);
                this.takedamage = DAMAGE_YES;
                //this.th_pain = fd_secret_use;
        }
@@ -168,7 +168,7 @@ void secret_reset(entity this)
 {
        if (this.spawnflags & DOOR_SECRET_YES_SHOOT)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10000);
+               SetResourceAmount(this, RESOURCE_HEALTH, 10000);
                this.takedamage = DAMAGE_YES;
        }
        setorigin(this, this.oldorigin);
@@ -253,7 +253,7 @@ spawnfunc(func_door_secret)
        if (this.spawnflags & DOOR_SECRET_YES_SHOOT)
        {
                //this.canteamdamage = true; // TODO
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10000);
+               SetResourceAmount(this, RESOURCE_HEALTH, 10000);
                this.takedamage = DAMAGE_YES;
                this.event_damage = fd_secret_damage;
        }
index 866fd88a569ddd4e67488ba23ba0a72e8ac5715f..3f3e6c579bccbe612b48d4289f6c059b006a88f4 100644 (file)
@@ -37,7 +37,7 @@ void trigger_heal_init(entity this)
        if(!this.delay)
                this.delay = 1;
        if(!GetResourceAmount(this, RESOURCE_HEALTH))
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 10); // TODO: use a special field for this, it doesn't have actual health!
+               SetResourceAmount(this, RESOURCE_HEALTH, 10); // TODO: use a special field for this, it doesn't have actual health!
        if(!this.max_health)
                this.max_health = 200; // max health topoff for field
        if(this.noise == "")
index bc6049e19f78d9c4863d925507503702d02794ee..181cde6fdcb579e1aeefbaa9c66d83016f7e806c 100644 (file)
@@ -7,7 +7,7 @@ void multi_wait(entity this)
 {
        if (this.max_health)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
                this.takedamage = DAMAGE_YES;
                this.solid = SOLID_BBOX;
        }
@@ -135,7 +135,7 @@ void multi_reset(entity this)
                settouch(this, multi_touch);
        if (this.max_health)
        {
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
                this.takedamage = DAMAGE_YES;
                this.solid = SOLID_BBOX;
        }
index 5d7c5b6f464a2c921fa6605cbab669de62b034af..22661333b4252b2f7cfe91dd0ae66ea1bd18f1d9 100644 (file)
@@ -73,7 +73,7 @@ spawnfunc(trigger_secret)
        this.targetname = "";
 
        // you can't just shoot a room to find it, can you?
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 0);
+       SetResourceAmount(this, RESOURCE_HEALTH, 0);
 
        // a secret can not be delayed
        this.delay = 0;
index 88120a0ea7550acbb93cd46e9b94022165b18ba2..8e39ff3f927a89fe1242d7b335549b5261285813 100644 (file)
@@ -325,14 +325,14 @@ void M_Mage_Attack_Teleport(entity this, entity targ)
 void M_Mage_Defend_Shield_Remove(entity this)
 {
        this.effects &= ~(EF_ADDITIVE | EF_BLUE);
-       SetResourceAmountExplicit(this, RESOURCE_ARMOR, autocvar_g_monsters_armor_blockpercent);
+       SetResourceAmount(this, RESOURCE_ARMOR, autocvar_g_monsters_armor_blockpercent);
 }
 
 void M_Mage_Defend_Shield(entity this)
 {
        this.effects |= (EF_ADDITIVE | EF_BLUE);
        this.mage_shield_delay = time + (autocvar_g_monster_mage_shield_delay);
-       SetResourceAmountExplicit(this, RESOURCE_ARMOR, autocvar_g_monster_mage_shield_blockpercent);
+       SetResourceAmount(this, RESOURCE_ARMOR, autocvar_g_monster_mage_shield_blockpercent);
        this.mage_shield_time = time + (autocvar_g_monster_mage_shield_time);
        setanim(this, this.anim_shoot, true, true, true);
        this.attack_finished_single[0] = time + 1;
@@ -469,7 +469,7 @@ METHOD(Mage, mr_anim, bool(Mage this, entity actor))
 METHOD(Mage, mr_setup, bool(Mage this, entity actor))
 {
     TC(Mage, this);
-    if(!GetResourceAmount(this, RESOURCE_HEALTH)) SetResourceAmountExplicit(actor, RESOURCE_HEALTH, autocvar_g_monster_mage_health);
+    if(!GetResourceAmount(this, RESOURCE_HEALTH)) SetResourceAmount(actor, RESOURCE_HEALTH, autocvar_g_monster_mage_health);
     if(!actor.speed) { actor.speed = (autocvar_g_monster_mage_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_mage_speed_run); }
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_mage_speed_stop); }
index 9981474f9bc7ad92a696dc9f8792d01a88cb0d15..21ec72aaa8076c4a4a43b865aaaec1a4f5bbef99 100644 (file)
@@ -136,7 +136,7 @@ void M_Shambler_Attack_Lightning(entity this)
        settouch(gren, M_Shambler_Attack_Lightning_Touch);
 
        gren.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(gren, RESOURCE_HEALTH, 50);
+       SetResourceAmount(gren, RESOURCE_HEALTH, 50);
        gren.damageforcescale = 0;
        gren.event_damage = M_Shambler_Attack_Lightning_Damage;
        gren.damagedbycontents = true;
@@ -246,7 +246,7 @@ METHOD(Shambler, mr_anim, bool(Shambler this, entity actor))
 METHOD(Shambler, mr_setup, bool(Shambler this, entity actor))
 {
     TC(Shambler, this);
-    if(!GetResourceAmount(this, RESOURCE_HEALTH)) SetResourceAmountExplicit(actor, RESOURCE_HEALTH, autocvar_g_monster_shambler_health);
+    if(!GetResourceAmount(this, RESOURCE_HEALTH)) SetResourceAmount(actor, RESOURCE_HEALTH, autocvar_g_monster_shambler_health);
     if(!actor.attack_range) actor.attack_range = 150;
     if(!actor.speed) { actor.speed = (autocvar_g_monster_shambler_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_shambler_speed_run); }
index d847cf4e6cd2942494bb8beeb61d45abae40ad81..1b454fe7c4cede2977f6d2f4b92918f1167a2cc1 100644 (file)
@@ -151,7 +151,7 @@ void M_Spider_Attack_Web(entity this)
        setsize(proj, '-4 -4 -4', '4 4 4');
        proj.takedamage = DAMAGE_NO;
        proj.damageforcescale = 0;
-       SetResourceAmountExplicit(proj, RESOURCE_HEALTH, 500);
+       SetResourceAmount(proj, RESOURCE_HEALTH, 500);
        proj.event_damage = func_null;
        proj.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, proj);
@@ -227,7 +227,7 @@ METHOD(Spider, mr_anim, bool(Spider this, entity actor))
 METHOD(Spider, mr_setup, bool(Spider this, entity actor))
 {
     TC(Spider, this);
-    if(!GetResourceAmount(this, RESOURCE_HEALTH)) SetResourceAmountExplicit(actor, RESOURCE_HEALTH, autocvar_g_monster_spider_health);
+    if(!GetResourceAmount(this, RESOURCE_HEALTH)) SetResourceAmount(actor, RESOURCE_HEALTH, autocvar_g_monster_spider_health);
     if(!actor.speed) { actor.speed = (autocvar_g_monster_spider_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_spider_speed_run); }
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_spider_speed_stop); }
index f6c905d6d1893bcd4d1d3f134e28d62799da3ae7..b1da1c2adcfc6d0a6ac6f4fdebdced5598e8a1ec 100644 (file)
@@ -152,7 +152,7 @@ METHOD(Wyvern, mr_anim, bool(Wyvern this, entity actor))
 METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor))
 {
     TC(Wyvern, this);
-    if(!GetResourceAmount(this, RESOURCE_HEALTH)) SetResourceAmountExplicit(actor, RESOURCE_HEALTH, autocvar_g_monster_wyvern_health);
+    if(!GetResourceAmount(this, RESOURCE_HEALTH)) SetResourceAmount(actor, RESOURCE_HEALTH, autocvar_g_monster_wyvern_health);
     if(!actor.speed) { actor.speed = (autocvar_g_monster_wyvern_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_wyvern_speed_run); }
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_wyvern_speed_stop); }
index aaa27d21b2894ed7e86a6fe021993c041b164db4..a219338343276fef8e08894e707987a5b93b9c2e 100644 (file)
@@ -78,12 +78,12 @@ void M_Zombie_Defend_Block_End(entity this)
                return;
 
        setanim(this, this.anim_blockend, false, true, true);
-       SetResourceAmountExplicit(this, RESOURCE_ARMOR, autocvar_g_monsters_armor_blockpercent);
+       SetResourceAmount(this, RESOURCE_ARMOR, autocvar_g_monsters_armor_blockpercent);
 }
 
 bool M_Zombie_Defend_Block(entity this)
 {
-       SetResourceAmountExplicit(this, RESOURCE_ARMOR, 0.9);
+       SetResourceAmount(this, RESOURCE_ARMOR, 0.9);
        this.state = MONSTER_ATTACK_MELEE; // freeze monster
        this.attack_finished_single[0] = time + 2.1;
        this.anim_finished = this.attack_finished_single[0];
@@ -148,7 +148,7 @@ METHOD(Zombie, mr_pain, float(Zombie this, entity actor, float damage_take, enti
 METHOD(Zombie, mr_death, bool(Zombie this, entity actor))
 {
     TC(Zombie, this);
-    SetResourceAmountExplicit(actor, RESOURCE_ARMOR, autocvar_g_monsters_armor_blockpercent);
+    SetResourceAmount(actor, RESOURCE_ARMOR, autocvar_g_monsters_armor_blockpercent);
 
     setanim(actor, ((random() > 0.5) ? actor.anim_die1 : actor.anim_die2), false, true, true);
     return true;
@@ -180,7 +180,7 @@ METHOD(Zombie, mr_anim, bool(Zombie this, entity actor))
 METHOD(Zombie, mr_setup, bool(Zombie this, entity actor))
 {
     TC(Zombie, this);
-    if(!GetResourceAmount(actor, RESOURCE_HEALTH)) SetResourceAmountExplicit(actor, RESOURCE_HEALTH, autocvar_g_monster_zombie_health);
+    if(!GetResourceAmount(actor, RESOURCE_HEALTH)) SetResourceAmount(actor, RESOURCE_HEALTH, autocvar_g_monster_zombie_health);
     if(!actor.speed) { actor.speed = (autocvar_g_monster_zombie_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_zombie_speed_run); }
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_zombie_speed_stop); }
index 0fd6c94ac01304520502cc84b1457f375ed0a0f7..4018729bc1a1d033fea2bbc1e0dca5e2016caf70 100644 (file)
@@ -531,7 +531,7 @@ void Monster_Dead_Fade(entity this)
                this.takedamage = DAMAGE_NO;
                setorigin(this, this.pos1);
                this.angles = this.pos2;
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+               SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
                setmodel(this, MDL_Null);
        }
        else
@@ -898,7 +898,7 @@ void Monster_Reset(entity this)
 
        Unfreeze(this, false); // remove any icy remains
 
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+       SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        this.velocity = '0 0 0';
        this.enemy = NULL;
        this.goalentity = NULL;
@@ -1164,7 +1164,7 @@ void Monster_Frozen_Think(entity this)
        if (STAT(FROZEN, this) == FROZEN_TEMP_REVIVING)
        {
                STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + this.ticrate * this.revive_speed, 1);
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, this) * this.max_health));
+               SetResourceAmount(this, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, this) * this.max_health));
                this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1);
 
                if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite)
@@ -1176,7 +1176,7 @@ void Monster_Frozen_Think(entity this)
        else if (STAT(FROZEN, this) == FROZEN_TEMP_DYING)
        {
                STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) - this.ticrate * this.revive_speed, 1);
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, max(0, autocvar_g_nades_ice_health + (this.max_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this)));
+               SetResourceAmount(this, RESOURCE_HEALTH, max(0, autocvar_g_nades_ice_health + (this.max_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this)));
 
                if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite)
                        WaypointSprite_UpdateHealth(this.sprite, GetResourceAmount(this, RESOURCE_HEALTH));
@@ -1254,8 +1254,8 @@ bool Monster_Spawn_Setup(entity this)
        mon.mr_setup(mon, this);
 
        // ensure some basic needs are met
-       if(!GetResourceAmount(this, RESOURCE_HEALTH)) { SetResourceAmountExplicit(this, RESOURCE_HEALTH, 100); }
-       if(!GetResourceAmount(this, RESOURCE_ARMOR)) { SetResourceAmountExplicit(this, RESOURCE_ARMOR, bound(0.2, 0.5 * MONSTER_SKILLMOD(this), 0.9)); }
+       if(!GetResourceAmount(this, RESOURCE_HEALTH)) { SetResourceAmount(this, RESOURCE_HEALTH, 100); }
+       if(!GetResourceAmount(this, RESOURCE_ARMOR)) { SetResourceAmount(this, RESOURCE_ARMOR, bound(0.2, 0.5 * MONSTER_SKILLMOD(this), 0.9)); }
        if(!this.target_range) { this.target_range = autocvar_g_monsters_target_range; }
        if(!this.respawntime) { this.respawntime = autocvar_g_monsters_respawn_delay; }
        if(!this.monster_moveflags) { this.monster_moveflags = MONSTER_MOVE_WANDER; }
@@ -1265,7 +1265,7 @@ bool Monster_Spawn_Setup(entity this)
        if(!(this.spawnflags & MONSTERFLAG_RESPAWNED))
        {
                Monster_Miniboss_Check(this);
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH) * MONSTER_SKILLMOD(this));
+               SetResourceAmount(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH) * MONSTER_SKILLMOD(this));
 
                if(!this.skin)
                        this.skin = rint(random() * 4);
index 42e3adbd73b74c6fa8eb1d23abfcde0c8e086145..d899d1ce4458ceb2872960f600b9c2d0201c52eb 100644 (file)
@@ -19,7 +19,7 @@ int autocvar_g_instagib_ammo_drop;
 void ammo_vaporizercells_init(Pickup this, entity item)
 {
     if(!GetResourceAmount(item, RESOURCE_CELLS))
-        SetResourceAmountExplicit(item, RESOURCE_CELLS, autocvar_g_instagib_ammo_drop);
+        SetResourceAmount(item, RESOURCE_CELLS, autocvar_g_instagib_ammo_drop);
 }
 #endif
 REGISTER_ITEM(VaporizerCells, Ammo) {
index 443fe2478139a9527df39ab979f13a85805f09f8..fa04e2a00dd32b08fa36eafebca1ac19512ab83b 100644 (file)
@@ -10,7 +10,7 @@ MUTATOR_HOOKFUNCTION(invincibleprojectiles, EditProjectile)
        if(GetResourceAmount(proj, RESOURCE_HEALTH))
        {
                // disable health which in effect disables damage calculations
-               SetResourceAmountExplicit(proj, RESOURCE_HEALTH, 0);
+               SetResourceAmount(proj, RESOURCE_HEALTH, 0);
        }
 }
 
index 1fdf5fd7aad1a5e2ef0e85c68d326da0fb6845bc..6c48a8ec6e5ee6a6f3bbba1dc8d5b72a3c22ab9a 100644 (file)
@@ -32,7 +32,7 @@ void orb_setup(entity e)
 
        e.draw = orb_draw;
        IL_PUSH(g_drawables, e);
-       SetResourceAmountExplicit(e, RESOURCE_HEALTH, 255);
+       SetResourceAmount(e, RESOURCE_HEALTH, 255);
        set_movetype(e, MOVETYPE_NONE);
        e.solid = SOLID_NOT;
        e.drawmask = MASK_NORMAL;
index 50c842d9844144c6c5da0b60ed31f41c9c7cd33b..b5237b35df4f78c3dcdf27191dc2c49406de3e22 100644 (file)
@@ -100,7 +100,7 @@ void W_OverkillRocketPropelledChainsaw_Attack(Weapon thiswep, entity actor, .ent
 
        missile.takedamage = DAMAGE_YES;
        missile.damageforcescale = WEP_CVAR_PRI(okrpc, damageforcescale);
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR_PRI(okrpc, health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR_PRI(okrpc, health));
        missile.event_damage = W_OverkillRocketPropelledChainsaw_Damage;
        missile.damagedbycontents = true;
        IL_PUSH(g_damagedbycontents, missile);
index e74cfb1152844c485c94e9f72705d7d004f46e54..5e090d394802fb3a37e401a7822ad889d594c249 100644 (file)
@@ -30,7 +30,7 @@ MUTATOR_HOOKFUNCTION(vh, GrappleHookThink)
                entity targ = ((SAME_TEAM(thehook.owner, thehook.aiment)) ? thehook.aiment : thehook.owner);
                // TODO: we can't do this due to an issue with globals and the mutator arguments
                //Heal(targ, thehook.owner, autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
-               SetResourceAmountExplicit(targ, RESOURCE_HEALTH, min(GetResourceAmount(targ, RESOURCE_HEALTH) + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max));
+               SetResourceAmount(targ, RESOURCE_HEALTH, min(GetResourceAmount(targ, RESOURCE_HEALTH) + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max));
 
                if(dmgent == thehook.owner)
                        TakeResource(dmgent, RESOURCE_HEALTH, autocvar_g_vampirehook_damage); // FIXME: friendly fire?!
index 8a447aa624e482d03546e892eacd731a100f501a..3596aef750604b27ae84134de15e18aaf3c68a52 100644 (file)
@@ -130,7 +130,7 @@ void Ent_WaypointSprite(entity this, bool isnew)
         int t = ReadByte();
         if (t < 192)
         {
-            SetResourceAmountExplicit(this, RESOURCE_HEALTH, t / 191.0);
+            SetResourceAmount(this, RESOURCE_HEALTH, t / 191.0);
             this.build_finished = 0;
         }
         else
@@ -146,7 +146,7 @@ void Ent_WaypointSprite(entity this, bool isnew)
     }
     else
     {
-        SetResourceAmountExplicit(this, RESOURCE_HEALTH, -1);
+        SetResourceAmount(this, RESOURCE_HEALTH, -1);
         this.build_finished = 0;
     }
 
@@ -652,14 +652,14 @@ void Draw_WaypointSprite(entity this)
         if (time < this.build_finished + 0.25)
         {
             if (time < this.build_started)
-                SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.build_starthealth);
+                SetResourceAmount(this, RESOURCE_HEALTH, this.build_starthealth);
             else if (time < this.build_finished)
-                SetResourceAmountExplicit(this, RESOURCE_HEALTH, (time - this.build_started) / (this.build_finished - this.build_started) * (1 - this.build_starthealth) + this.build_starthealth);
+                SetResourceAmount(this, RESOURCE_HEALTH, (time - this.build_started) / (this.build_finished - this.build_started) * (1 - this.build_starthealth) + this.build_starthealth);
             else
-                SetResourceAmountExplicit(this, RESOURCE_HEALTH, 1);
+                SetResourceAmount(this, RESOURCE_HEALTH, 1);
         }
         else
-            SetResourceAmountExplicit(this, RESOURCE_HEALTH, -1);
+            SetResourceAmount(this, RESOURCE_HEALTH, -1);
     }
 
     o = drawspritearrow(o, ang, rgb, a, SPRITE_ARROW_SCALE * t);
@@ -832,7 +832,7 @@ void WaypointSprite_UpdateHealth(entity e, float f)
     float step = e.max_health / 40;
     if ((floor(f / step) != floor(GetResourceAmount(e, RESOURCE_HEALTH) / step)) || e.pain_finished)
     {
-        SetResourceAmountExplicit(e, RESOURCE_HEALTH, f);
+        SetResourceAmount(e, RESOURCE_HEALTH, f);
         e.pain_finished = 0;
         e.SendFlags |= 0x80;
     }
index 6cdda5103955a428443e1194c0711c310d692fe5..51d3bc7fcee9958d5169e823299e4790966e421a 100644 (file)
@@ -224,7 +224,7 @@ void turret_construct(entity this, bool isnew)
        set_movetype(this.tur_head, MOVETYPE_NOCLIP);
        set_movetype(this, MOVETYPE_NOCLIP);
        this.tur_head.angles                    = this.angles;
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 255);
+       SetResourceAmount(this, RESOURCE_HEALTH, 255);
        this.solid                                              = SOLID_BBOX;
        this.tur_head.solid                             = SOLID_NOT;
        set_movetype(this, MOVETYPE_NOCLIP);
@@ -433,7 +433,7 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
                else if(myhp && myhp < _tmp)
                        this.helpme = 0; // we're being healed, don't spam help me waypoints
 
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, _tmp);
+               SetResourceAmount(this, RESOURCE_HEALTH, _tmp);
        }
        return true;
 }
index b3ddc61cfa2ac3d37085d1abd07c5512a5d3c940..bcf25284a141ca176f2cf69ada88e4251f68d132 100644 (file)
@@ -185,7 +185,7 @@ void turret_die(entity this)
        this.event_heal = func_null;
        this.takedamage                  = DAMAGE_NO;
 
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 0);
+       SetResourceAmount(this, RESOURCE_HEALTH, 0);
 
 // Go boom
        //RadiusDamage (this,this, min(this.ammo,50),min(this.ammo,50) * 0.25,250,NULL,min(this.ammo,50)*5,DEATH_TURRET,NULL);
@@ -286,7 +286,7 @@ void turret_respawn(entity this)
        this.avelocity                          = '0 0 0';
        this.tur_head.avelocity         = this.avelocity;
        this.tur_head.angles            = this.idle_aim;
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, this.max_health);
+       SetResourceAmount(this, RESOURCE_HEALTH, this.max_health);
        this.enemy                                      = NULL;
        this.volly_counter                      = this.shot_volly;
        this.ammo                                       = this.ammo_max;
@@ -399,7 +399,7 @@ void load_unit_settings(entity ent, bool is_reload)
                ent.tur_head.angles = '0 0 0';
        }
 
-       SetResourceAmountExplicit(ent, RESOURCE_HEALTH, cvar(strcat(sbase,"_health")) * ent.turret_scale_health);
+       SetResourceAmount(ent, RESOURCE_HEALTH, cvar(strcat(sbase,"_health")) * ent.turret_scale_health);
        ent.respawntime = cvar(strcat(sbase,"_respawntime")) * ent.turret_scale_respawn;
 
        ent.shot_dmg             = cvar(strcat(sbase,"_shot_dmg")) * ent.turret_scale_damage;
@@ -498,7 +498,7 @@ entity turret_projectile(entity actor, Sound _snd, float _size, float _health, f
        PROJECTILE_MAKETRIGGER(proj);
        if(_health)
        {
-               SetResourceAmountExplicit(proj, RESOURCE_HEALTH, _health);
+               SetResourceAmount(proj, RESOURCE_HEALTH, _health);
                proj.takedamage  = DAMAGE_YES;
                proj.event_damage  = turret_projectile_damage;
        }
@@ -1311,7 +1311,7 @@ bool turret_initialize(entity this, Turret tur)
 
        if(!this.team || !teamplay)             { this.team = FLOAT_MAX; }
        if(!this.ticrate)                               { this.ticrate = ((this.turret_flags & TUR_FLAG_SUPPORT) ? 0.2 : 0.1); }
-       if(!GetResourceAmount(this, RESOURCE_HEALTH)) { SetResourceAmountExplicit(this, RESOURCE_HEALTH, 1000); }
+       if(!GetResourceAmount(this, RESOURCE_HEALTH)) { SetResourceAmount(this, RESOURCE_HEALTH, 1000); }
        if(!this.shot_refire)                   { this.shot_refire = 1; }
        if(!this.tur_shotorg)                   { this.tur_shotorg = '50 0 50'; }
        if(!this.turret_flags)                  { this.turret_flags = TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER; }
index 6aa0865e69d1e4fac73d93ab9177f72278071985..cdabf3391bab6167e572bd7e8050a251117da7a1 100644 (file)
@@ -218,7 +218,7 @@ void walker_fire_rocket(entity this, vector org)
     rocket.bot_dodgerating     = 50;
     rocket.takedamage           = DAMAGE_YES;
     rocket.damageforcescale   = 2;
-    SetResourceAmountExplicit(rocket, RESOURCE_HEALTH, 25);
+    SetResourceAmount(rocket, RESOURCE_HEALTH, 25);
     rocket.tur_shotorg         = randomvec() * 512;
     rocket.cnt                         = time + 1;
     rocket.enemy                         = this.enemy;
index e8dd2faa35dcb9d62aae4e4fbb77c4d0a7e87d5a..d5bdb5c4fe6d710d13cc1efdb1d44c8f4da413b8 100644 (file)
@@ -282,7 +282,7 @@ entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound,
        {
                proj.takedamage    = DAMAGE_AIM;
                proj.event_damage        = vehicles_projectile_damage;
-               SetResourceAmountExplicit(proj, RESOURCE_HEALTH, _health);
+               SetResourceAmount(proj, RESOURCE_HEALTH, _health);
        }
        else
                proj.flags |= FL_NOTARGET;
index 377b1930871d2f15c812a8a0ca2211c52e517750..d0bbdeddf95666c0bbd7fcc785bc64a190f367f3 100644 (file)
@@ -802,7 +802,7 @@ METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance))
 
     Send_Effect(EFFECT_EXPLOSION_MEDIUM, findbetterlocation(instance.origin, 16), '0 0 0', 1);
 
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, 0);
+    SetResourceAmount(instance, RESOURCE_HEALTH, 0);
     instance.event_damage      = func_null;
     instance.solid                     = SOLID_NOT;
     instance.takedamage                = DAMAGE_NO;
@@ -887,7 +887,7 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance))
     if(!autocvar_g_vehicle_bumblebee_swim)
        instance.dphitcontentsmask |= DPCONTENTS_LIQUIDSMASK;
 
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_bumblebee_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_bumblebee_health);
     instance.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
     instance.solid = SOLID_BBOX;
     set_movetype(instance, MOVETYPE_TOSS);
@@ -914,7 +914,7 @@ METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh, entity instance))
 
     instance.vehicle_exit = bumblebee_exit;
     instance.respawntime = autocvar_g_vehicle_bumblebee_respawntime;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_bumblebee_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_bumblebee_health);
     instance.max_health = GetResourceAmount(instance, RESOURCE_HEALTH);
     instance.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
 }
index c7f7af8ac6efa82854bca37985be91fb85afabe2..1cd442117ebb79b134d6ff3d93548b5c50ee957a 100644 (file)
@@ -544,7 +544,7 @@ METHOD(Racer, vr_spawn, void(Racer thisveh, entity instance))
 
     setthink(instance, racer_think);
     instance.nextthink   = time;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_racer_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_racer_health);
     instance.vehicle_shield = autocvar_g_vehicle_racer_shield;
 
     set_movetype(instance, MOVETYPE_TOSS);
@@ -557,7 +557,7 @@ METHOD(Racer, vr_spawn, void(Racer thisveh, entity instance))
     instance.bouncefactor = autocvar_g_vehicle_racer_bouncefactor;
     instance.bouncestop = autocvar_g_vehicle_racer_bouncestop;
     instance.damageforcescale = 0.5;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_racer_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_racer_health);
     instance.vehicle_shield = autocvar_g_vehicle_racer_shield;
 #endif
 }
@@ -566,7 +566,7 @@ METHOD(Racer, vr_death, void(Racer thisveh, entity instance))
 {
 #ifdef SVQC
     setSendEntity(instance, func_null); // stop networking this racer (for now)
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, 0);
+    SetResourceAmount(instance, RESOURCE_HEALTH, 0);
     instance.event_damage      = func_null;
     instance.solid                     = SOLID_CORPSE;
     instance.takedamage                = DAMAGE_NO;
@@ -625,7 +625,7 @@ METHOD(Racer, vr_setup, void(Racer thisveh, entity instance))
         instance.vehicle_flags |= VHF_HEALTHREGEN;
 
     instance.respawntime = autocvar_g_vehicle_racer_respawntime;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_racer_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_racer_health);
     instance.vehicle_shield = autocvar_g_vehicle_racer_shield;
     instance.max_health = GetResourceAmount(instance, RESOURCE_HEALTH);
 #endif
index 0150ee98f930fe673f2897d0592540c87981ff3e..8ec9e47d21e8a6e9a6f218ba3c09898aa112e0a7 100644 (file)
@@ -609,7 +609,7 @@ METHOD(Raptor, vr_enter, void(Raptor thisveh, entity instance))
 }
 METHOD(Raptor, vr_death, void(Raptor thisveh, entity instance))
 {
-       SetResourceAmountExplicit(instance, RESOURCE_HEALTH, 0);
+       SetResourceAmount(instance, RESOURCE_HEALTH, 0);
     instance.event_damage              = func_null;
     instance.solid                             = SOLID_CORPSE;
     instance.takedamage                        = DAMAGE_NO;
@@ -701,7 +701,7 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance))
     }
 
     instance.frame               = 0;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health);
     instance.vehicle_shield = autocvar_g_vehicle_raptor_shield;
     set_movetype(instance, MOVETYPE_TOSS);
     instance.solid               = SOLID_SLIDEBOX;
@@ -720,7 +720,7 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance))
     instance.bouncefactor = autocvar_g_vehicle_raptor_bouncefactor;
     instance.bouncestop = autocvar_g_vehicle_raptor_bouncestop;
     instance.damageforcescale = 0.25;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health);
     instance.vehicle_shield = autocvar_g_vehicle_raptor_shield;
 }
 METHOD(Raptor, vr_setup, void(Raptor thisveh, entity instance))
@@ -739,7 +739,7 @@ METHOD(Raptor, vr_setup, void(Raptor thisveh, entity instance))
 
     instance.vehicle_exit = raptor_exit;
     instance.respawntime = autocvar_g_vehicle_raptor_respawntime;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health);
     instance.vehicle_shield = autocvar_g_vehicle_raptor_shield;
     instance.max_health = GetResourceAmount(instance, RESOURCE_HEALTH);
 
index 53475d6cfd382e6efe95ae50ae09642b6fe04a89..8266a9a2058f3f5130a4b43dc9baa5bfe77c274a 100644 (file)
@@ -74,7 +74,7 @@ METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weapone
             _flare.solid = SOLID_CORPSE;
             _flare.takedamage = DAMAGE_YES;
             _flare.event_damage = raptor_flare_damage;
-            SetResourceAmountExplicit(_flare, RESOURCE_HEALTH, 20);
+            SetResourceAmount(_flare, RESOURCE_HEALTH, 20);
             _flare.tur_impacttime = time + autocvar_g_vehicle_raptor_flare_lifetime;
             settouch(_flare, raptor_flare_touch);
         }
index 323b025e0ebb5769d434004073a1fb04598176c5..4c085f138e38fcbe3528afafb1a7cfc79fb5ec38 100644 (file)
@@ -540,7 +540,7 @@ METHOD(Spiderbot, vr_think, void(Spiderbot thisveh, entity instance))
 }
 METHOD(Spiderbot, vr_death, void(Spiderbot thisveh, entity instance))
 {
-       SetResourceAmountExplicit(instance, RESOURCE_HEALTH, 0);
+       SetResourceAmount(instance, RESOURCE_HEALTH, 0);
     instance.event_damage              = func_null;
     instance.takedamage                        = DAMAGE_NO;
     settouch(instance, func_null);
@@ -582,7 +582,7 @@ METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance))
     setorigin(instance, instance.pos1 + '0 0 128');
     instance.angles = instance.pos2;
     instance.damageforcescale = 0.03;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_spiderbot_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_spiderbot_health);
     instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
 
     instance.PlayerPhysplug = spiderbot_frame;
@@ -599,7 +599,7 @@ METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance))
         instance.vehicle_flags |= VHF_HEALTHREGEN;
 
     instance.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
-    SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_spiderbot_health);
+    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_spiderbot_health);
     instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
     instance.max_health = GetResourceAmount(instance, RESOURCE_HEALTH);
     instance.pushable = true; // spiderbot can use jumppads
index ef4e3eb7d7709e19b709396f0a30cf0d234820e4..8aea03312a5ab86137d8be4d18275559fef52b44 100644 (file)
@@ -140,7 +140,7 @@ void W_Arc_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity)
        missile.bot_dodgerating = WEP_CVAR(arc, bolt_damage);
 
        missile.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR(arc, bolt_health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR(arc, bolt_health));
        missile.damageforcescale = WEP_CVAR(arc, bolt_damageforcescale);
        missile.event_damage = W_Arc_Bolt_Damage;
        missile.damagedbycontents = true;
index f8539b14c36b7eeb800830de893c625581e06337..b280665c881979f6f68eb2f8ff69686fa4d60aef 100644 (file)
@@ -322,7 +322,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int
 
        missile.takedamage = DAMAGE_YES;
        missile.damageforcescale = WEP_CVAR(devastator, damageforcescale);
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR(devastator, health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR(devastator, health));
        missile.event_damage = W_Devastator_Damage;
        missile.damagedbycontents = true;
        IL_PUSH(g_damagedbycontents, missile);
index e22b5e941270b7f2757b407675b6db7c6ead44a5..b44731eab872e667711724ee74e5b75b57f6704c 100644 (file)
@@ -258,7 +258,7 @@ void W_Electro_Orb_Stick(entity this, entity to)
 
        newproj.takedamage = this.takedamage;
        newproj.damageforcescale = this.damageforcescale;
-       SetResourceAmountExplicit(newproj, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
+       SetResourceAmount(newproj, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
        newproj.event_damage = this.event_damage;
        newproj.spawnshieldtime = this.spawnshieldtime;
        newproj.damagedbycontents = true;
@@ -381,7 +381,7 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity)
        setsize(proj, '-4 -4 -4', '4 4 4');
        proj.takedamage = DAMAGE_YES;
        proj.damageforcescale = WEP_CVAR_SEC(electro, damageforcescale);
-       SetResourceAmountExplicit(proj, RESOURCE_HEALTH, WEP_CVAR_SEC(electro, health));
+       SetResourceAmount(proj, RESOURCE_HEALTH, WEP_CVAR_SEC(electro, health));
        proj.event_damage = W_Electro_Orb_Damage;
        proj.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, proj);
index ea7f5b8aea19e1031d1506847a0a117940701f1c..f4936cdf474944cf84a1ef2fec3e0389921109f9 100644 (file)
@@ -147,7 +147,7 @@ void W_Fireball_Attack1(entity actor, .entity weaponentity)
        proj.use = W_Fireball_Explode_use;
        setthink(proj, W_Fireball_Think);
        proj.nextthink = time;
-       SetResourceAmountExplicit(proj, RESOURCE_HEALTH, WEP_CVAR_PRI(fireball, health));
+       SetResourceAmount(proj, RESOURCE_HEALTH, WEP_CVAR_PRI(fireball, health));
        proj.team = actor.team;
        proj.event_damage = W_Fireball_Damage;
        proj.takedamage = DAMAGE_YES;
index 58be8f835f490ff3eac82c615a8257c8d047c27a..417a425685fbb7dc4eb234173c64d2fda4acfa3b 100644 (file)
@@ -91,7 +91,7 @@ void W_Hagar_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        missile.bot_dodgerating = WEP_CVAR_PRI(hagar, damage);
 
        missile.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR_PRI(hagar, health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR_PRI(hagar, health));
        missile.damageforcescale = WEP_CVAR_PRI(hagar, damageforcescale);
        missile.event_damage = W_Hagar_Damage;
        missile.damagedbycontents = true;
@@ -137,7 +137,7 @@ void W_Hagar_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
 
        missile.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR_SEC(hagar, health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR_SEC(hagar, health));
        missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
        missile.event_damage = W_Hagar_Damage;
        missile.damagedbycontents = true;
@@ -200,7 +200,7 @@ void W_Hagar_Attack2_Load_Release(Weapon thiswep, entity actor, .entity weaponen
                missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
 
                missile.takedamage = DAMAGE_YES;
-               SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR_SEC(hagar, health));
+               SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR_SEC(hagar, health));
                missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
                missile.event_damage = W_Hagar_Damage;
                missile.damagedbycontents = true;
index e17e97620884e3ed75c1259a43f8da23d603abe2..d7c08219d7ae2159a6cbd51a897839784b4bf3fc 100644 (file)
@@ -54,7 +54,7 @@ void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage,
        if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
                return; // g_projectiles_damage says to halt
 
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
+       SetResourceAmount(this, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
 
        if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
                W_PrepareExplosionByDamage(this, this.realowner, W_Hook_Explode2);
@@ -88,7 +88,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        settouch(gren, W_Hook_Touch2);
 
        gren.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(gren, RESOURCE_HEALTH, WEP_CVAR_SEC(hook, health));
+       SetResourceAmount(gren, RESOURCE_HEALTH, WEP_CVAR_SEC(hook, health));
        gren.damageforcescale = WEP_CVAR_SEC(hook, damageforcescale);
        gren.event_damage = W_Hook_Damage;
        gren.damagedbycontents = true;
index 6063c666eb5093b0aea9ba9af3b17730948f342d..df4e7b002eebe6cd5cced4fa346467ab09663d3b 100644 (file)
@@ -27,7 +27,7 @@ void W_MineLayer_Stick(entity this, entity to)
 
        newmine.takedamage = this.takedamage;
        newmine.damageforcescale = this.damageforcescale;
-       SetResourceAmountExplicit(newmine, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
+       SetResourceAmount(newmine, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
        newmine.event_damage = this.event_damage;
        newmine.spawnshieldtime = this.spawnshieldtime;
        newmine.damagedbycontents = true;
@@ -289,7 +289,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
        mine.takedamage = DAMAGE_YES;
        mine.damageforcescale = WEP_CVAR(minelayer, damageforcescale);
-       SetResourceAmountExplicit(mine, RESOURCE_HEALTH, WEP_CVAR(minelayer, health));
+       SetResourceAmount(mine, RESOURCE_HEALTH, WEP_CVAR(minelayer, health));
        mine.event_damage = W_MineLayer_Damage;
        mine.damagedbycontents = true;
        IL_PUSH(g_damagedbycontents, mine);
index 6e2bc91cf98631be25a6a5b2bca7c8be659dbc02..23c7a5e47db922c09fb4f86610836757ac0e8657 100644 (file)
@@ -176,7 +176,7 @@ void W_Mortar_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        settouch(gren, W_Mortar_Grenade_Touch1);
 
        gren.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(gren, RESOURCE_HEALTH, WEP_CVAR_PRI(mortar, health));
+       SetResourceAmount(gren, RESOURCE_HEALTH, WEP_CVAR_PRI(mortar, health));
        gren.damageforcescale = WEP_CVAR_PRI(mortar, damageforcescale);
        gren.event_damage = W_Mortar_Grenade_Damage;
        gren.damagedbycontents = true;
@@ -227,7 +227,7 @@ void W_Mortar_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        settouch(gren, W_Mortar_Grenade_Touch2);
 
        gren.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(gren, RESOURCE_HEALTH, WEP_CVAR_SEC(mortar, health));
+       SetResourceAmount(gren, RESOURCE_HEALTH, WEP_CVAR_SEC(mortar, health));
        gren.damageforcescale = WEP_CVAR_SEC(mortar, damageforcescale);
        gren.event_damage = W_Mortar_Grenade_Damage;
        gren.damagedbycontents = true;
index e1fa34ccdfa1fc41b56a3dcba2824897182de82d..2b69ed0c813bdeb8bebaf0bc3b92a9edabb87ad4 100644 (file)
@@ -190,7 +190,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, .entity weaponentity, v
        missile.scale           = 2;
        missile.takedamage      = DAMAGE_YES;
        missile.weaponentity_fld = weaponentity;
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR(seeker, missile_health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR(seeker, missile_health));
        missile.damageforcescale = WEP_CVAR(seeker, missile_damageforcescale);
        missile.damagedbycontents = true;
        IL_PUSH(g_damagedbycontents, missile);
@@ -506,7 +506,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor, .entity weaponentity)
 
        missile.takedamage       = DAMAGE_YES;
        missile.event_damage     = W_Seeker_Tag_Damage;
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR(seeker, tag_health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR(seeker, tag_health));
        missile.damageforcescale = WEP_CVAR(seeker, tag_damageforcescale);
 
        setorigin(missile, w_shotorg);
index c22737ed0d2d2b5d02bd9595740dca3b322cab80..277db38fef521c485f3627e88450a08cfcb481cc 100644 (file)
@@ -355,7 +355,7 @@ float CheatCommand(entity this, int argc)
                                        entity e = spawn();
                                        e.model = strzone(argv(1));
                                        e.mdl = "rocket_explode";
-                                       SetResourceAmountExplicit(e, RESOURCE_HEALTH, 1000);
+                                       SetResourceAmount(e, RESOURCE_HEALTH, 1000);
                                        setorigin(e, trace_endpos);
                                        e.effects = EF_NOMODELFLAGS;
                                        if(f == 1)
index efd50481e7c8667531aa329071857a6f3c5888a9..265d2111da9a2f41f7ab60262fe79eed3fc45ea9 100644 (file)
@@ -311,14 +311,14 @@ void PutObserverInServer(entity this)
        if(this.damagedbycontents)
                IL_REMOVE(g_damagedbycontents, this);
        this.damagedbycontents = false;
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, FRAGS_SPECTATOR);
+       SetResourceAmount(this, RESOURCE_HEALTH, FRAGS_SPECTATOR);
        SetSpectatee_status(this, etof(this));
        this.takedamage = DAMAGE_NO;
        this.solid = SOLID_NOT;
        set_movetype(this, MOVETYPE_FLY_WORLDONLY); // user preference is controlled by playerprethink
        this.flags = FL_CLIENT | FL_NOTARGET;
        this.effects = 0;
-       SetResourceAmountExplicit(this, RESOURCE_ARMOR, autocvar_g_balance_armor_start); // was 666?!
+       SetResourceAmount(this, RESOURCE_ARMOR, autocvar_g_balance_armor_start); // was 666?!
        this.pauserotarmor_finished = 0;
        this.pauserothealth_finished = 0;
        this.pauseregen_finished = 0;
@@ -1657,15 +1657,15 @@ void SpectateCopy(entity this, entity spectatee)
        MUTATOR_CALLHOOK(SpectateCopy, spectatee, this);
        PS(this) = PS(spectatee);
        this.armortype = spectatee.armortype;
-       SetResourceAmountExplicit(this, RESOURCE_ARMOR, GetResourceAmount(spectatee, RESOURCE_ARMOR));
-       SetResourceAmountExplicit(this, RESOURCE_CELLS, GetResourceAmount(spectatee, RESOURCE_CELLS));
-       SetResourceAmountExplicit(this, RESOURCE_PLASMA, GetResourceAmount(spectatee, RESOURCE_PLASMA));
-       SetResourceAmountExplicit(this, RESOURCE_SHELLS, GetResourceAmount(spectatee, RESOURCE_SHELLS));
-       SetResourceAmountExplicit(this, RESOURCE_BULLETS, GetResourceAmount(spectatee, RESOURCE_BULLETS));
-       SetResourceAmountExplicit(this, RESOURCE_ROCKETS, GetResourceAmount(spectatee, RESOURCE_ROCKETS));
-       SetResourceAmountExplicit(this, RESOURCE_FUEL, GetResourceAmount(spectatee, RESOURCE_FUEL));
+       SetResourceAmount(this, RESOURCE_ARMOR, GetResourceAmount(spectatee, RESOURCE_ARMOR));
+       SetResourceAmount(this, RESOURCE_CELLS, GetResourceAmount(spectatee, RESOURCE_CELLS));
+       SetResourceAmount(this, RESOURCE_PLASMA, GetResourceAmount(spectatee, RESOURCE_PLASMA));
+       SetResourceAmount(this, RESOURCE_SHELLS, GetResourceAmount(spectatee, RESOURCE_SHELLS));
+       SetResourceAmount(this, RESOURCE_BULLETS, GetResourceAmount(spectatee, RESOURCE_BULLETS));
+       SetResourceAmount(this, RESOURCE_ROCKETS, GetResourceAmount(spectatee, RESOURCE_ROCKETS));
+       SetResourceAmount(this, RESOURCE_FUEL, GetResourceAmount(spectatee, RESOURCE_FUEL));
        this.effects = spectatee.effects & EFMASK_CHEAP; // eat performance
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(spectatee, RESOURCE_HEALTH));
+       SetResourceAmount(this, RESOURCE_HEALTH, GetResourceAmount(spectatee, RESOURCE_HEALTH));
        CS(this).impulse = 0;
        this.items = spectatee.items;
        STAT(LAST_PICKUP, this) = STAT(LAST_PICKUP, spectatee);
@@ -2429,7 +2429,7 @@ void PlayerPreThink (entity this)
                if (STAT(FROZEN, this) == FROZEN_TEMP_REVIVING)
                {
                        STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + frametime * this.revive_speed, 1);
-                       SetResourceAmountExplicit(this, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, this) * start_health));
+                       SetResourceAmount(this, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, this) * start_health));
                        this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1);
 
                        if (STAT(REVIVE_PROGRESS, this) >= 1)
@@ -2438,7 +2438,7 @@ void PlayerPreThink (entity this)
                else if (STAT(FROZEN, this) == FROZEN_TEMP_DYING)
                {
                        STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) - frametime * this.revive_speed, 1);
-                       SetResourceAmountExplicit(this, RESOURCE_HEALTH, max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this)));
+                       SetResourceAmount(this, RESOURCE_HEALTH, max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this)));
 
                        if (GetResourceAmount(this, RESOURCE_HEALTH) < 1)
                        {
index 65f231374f56a8053f23a2c2cce49f98df729c15..ff74d2ddb4ce1591c164ed81f99d07ea3d802564 100644 (file)
@@ -142,33 +142,33 @@ void target_give_init(entity this)
        IL_EACH(g_items, it.targetname == this.target,
        {
                if (it.classname == "weapon_devastator") {
-                       SetResourceAmountExplicit(this, RESOURCE_ROCKETS, GetResourceAmount(this, RESOURCE_ROCKETS) + it.count * WEP_CVAR_PRI(devastator, ammo)); // WEAPONTODO
+                       SetResourceAmount(this, RESOURCE_ROCKETS, GetResourceAmount(this, RESOURCE_ROCKETS) + it.count * WEP_CVAR_PRI(devastator, ammo)); // WEAPONTODO
                        this.netname = cons(this.netname, "devastator");
                }
                else if (it.classname == "weapon_vortex") {
-                       SetResourceAmountExplicit(this, RESOURCE_CELLS, GetResourceAmount(this, RESOURCE_CELLS) + it.count * WEP_CVAR_PRI(vortex, ammo)); // WEAPONTODO
+                       SetResourceAmount(this, RESOURCE_CELLS, GetResourceAmount(this, RESOURCE_CELLS) + it.count * WEP_CVAR_PRI(vortex, ammo)); // WEAPONTODO
                        this.netname = cons(this.netname, "vortex");
                }
                else if (it.classname == "weapon_electro") {
-                       SetResourceAmountExplicit(this, RESOURCE_CELLS, GetResourceAmount(this, RESOURCE_CELLS) + it.count * WEP_CVAR_PRI(electro, ammo)); // WEAPONTODO
+                       SetResourceAmount(this, RESOURCE_CELLS, GetResourceAmount(this, RESOURCE_CELLS) + it.count * WEP_CVAR_PRI(electro, ammo)); // WEAPONTODO
                        this.netname = cons(this.netname, "electro");
                }
                else if (it.classname == "weapon_hagar") {
-                       SetResourceAmountExplicit(this, RESOURCE_ROCKETS, GetResourceAmount(this, RESOURCE_ROCKETS) + it.count * WEP_CVAR_PRI(hagar, ammo)); // WEAPONTODO
+                       SetResourceAmount(this, RESOURCE_ROCKETS, GetResourceAmount(this, RESOURCE_ROCKETS) + it.count * WEP_CVAR_PRI(hagar, ammo)); // WEAPONTODO
                        this.netname = cons(this.netname, "hagar");
                }
                else if (it.classname == "weapon_crylink") {
-                       SetResourceAmountExplicit(this, RESOURCE_CELLS, GetResourceAmount(this, RESOURCE_CELLS) + it.count * WEP_CVAR_PRI(crylink, ammo)); // WEAPONTODO
+                       SetResourceAmount(this, RESOURCE_CELLS, GetResourceAmount(this, RESOURCE_CELLS) + it.count * WEP_CVAR_PRI(crylink, ammo)); // WEAPONTODO
                        this.netname = cons(this.netname, "crylink");
                }
                else if (it.classname == "weapon_mortar") {
-                       SetResourceAmountExplicit(this, RESOURCE_ROCKETS, GetResourceAmount(this, RESOURCE_ROCKETS) + it.count * WEP_CVAR_PRI(mortar, ammo)); // WEAPONTODO
+                       SetResourceAmount(this, RESOURCE_ROCKETS, GetResourceAmount(this, RESOURCE_ROCKETS) + it.count * WEP_CVAR_PRI(mortar, ammo)); // WEAPONTODO
                        this.netname = cons(this.netname, "mortar");
                }
                else if (it.classname == "item_armor_mega")
-                       SetResourceAmountExplicit(this, RESOURCE_ARMOR, 100);
+                       SetResourceAmount(this, RESOURCE_ARMOR, 100);
                else if (it.classname == "item_health_mega")
-                       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 200);
+                       SetResourceAmount(this, RESOURCE_HEALTH, 200);
                //remove(it); // removing ents in init functions causes havoc, workaround:
         setthink(it, SUB_Remove);
         it.nextthink = time;
index 49be7c4c3dcfd35f78308e3e0023b59f2765de47..cfdc00c57740fe411ae1e78c18d71657065bc125 100644 (file)
@@ -595,9 +595,9 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                // These are ALWAYS lethal
                // No damage modification here
                // Instead, prepare the victim for his death...
-               SetResourceAmountExplicit(targ, RESOURCE_ARMOR, 0);
+               SetResourceAmount(targ, RESOURCE_ARMOR, 0);
                targ.spawnshieldtime = 0;
-               SetResourceAmountExplicit(targ, RESOURCE_HEALTH, 0.9); // this is < 1
+               SetResourceAmount(targ, RESOURCE_HEALTH, 0.9); // this is < 1
                targ.flags -= targ.flags & FL_GODMODE;
                damage = 100000;
        }
index 68aa7154ecdc3928261ea584bd251be2c86d2c03..226ab2f1a2c4beb30c0e1f3707ae77466ab4dca1 100644 (file)
@@ -397,7 +397,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity)
 
        missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION;
 
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, autocvar_g_balance_grapplehook_health);
+       SetResourceAmount(missile, RESOURCE_HEALTH, autocvar_g_balance_grapplehook_health);
        missile.event_damage = GrapplingHook_Damage;
        missile.takedamage = DAMAGE_AIM;
        missile.damageforcescale = 0;
index 394c62d21a334485725765f4873298bb98cc0d7d..eb09f188d25abcf5c240b52f17a112d67df36c61 100644 (file)
@@ -1523,7 +1523,7 @@ void FixIntermissionClient(entity e)
        if(!e.autoscreenshot) // initial call
        {
                e.autoscreenshot = time + 0.8;  // used for autoscreenshot
-               SetResourceAmountExplicit(e, RESOURCE_HEALTH, -2342);
+               SetResourceAmount(e, RESOURCE_HEALTH, -2342);
                // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not)
                for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
index 5c564d56db45fc7baeabeb9c6fd22240cc4263df..3ba64a3b167c30e2421c92882f2a83d9dfedabb8 100644 (file)
@@ -593,7 +593,7 @@ void MapVote_Tick()
                // hide scoreboard again
                if(GetResourceAmount(it, RESOURCE_HEALTH) != 2342)
                {
-                       SetResourceAmountExplicit(it, RESOURCE_HEALTH, 2342);
+                       SetResourceAmount(it, RESOURCE_HEALTH, 2342);
                        CS(it).impulse = 0;
 
                        msg_entity = it;
index 3805df3f26126375a64a3fc52ce3748c0d362de7..b28aae40ddda82712c946547d7a91173ea67b3cf 100644 (file)
@@ -93,8 +93,8 @@ void CopyBody(entity this, float keepvelocity)
        clone.dphitcontentsmask = this.dphitcontentsmask;
        clone.death_time = this.death_time;
        clone.pain_finished = this.pain_finished;
-       SetResourceAmountExplicit(clone, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
-       SetResourceAmountExplicit(clone, RESOURCE_ARMOR, GetResourceAmount(this, RESOURCE_ARMOR));
+       SetResourceAmount(clone, RESOURCE_HEALTH, GetResourceAmount(this, RESOURCE_HEALTH));
+       SetResourceAmount(clone, RESOURCE_ARMOR, GetResourceAmount(this, RESOURCE_ARMOR));
        clone.armortype = this.armortype;
        clone.model = this.model;
        clone.modelindex = this.modelindex;
index 99f0c0d82e67ae65a15fe1b229efb3885dbe073b..623e43c06873750722595f63959460ab6c7ea030 100644 (file)
@@ -199,8 +199,8 @@ float Portal_TeleportPlayer(entity teleporter, entity player)
        // reset fade counter
        teleporter.portal_wants_to_vanish = 0;
        teleporter.fade_time = ((autocvar_g_balance_portal_lifetime >= 0) ? time + autocvar_g_balance_portal_lifetime : 0);
-       SetResourceAmountExplicit(teleporter, RESOURCE_HEALTH, autocvar_g_balance_portal_health);
-       SetResourceAmountExplicit(teleporter.enemy, RESOURCE_HEALTH, autocvar_g_balance_portal_health);
+       SetResourceAmount(teleporter, RESOURCE_HEALTH, autocvar_g_balance_portal_health);
+       SetResourceAmount(teleporter.enemy, RESOURCE_HEALTH, autocvar_g_balance_portal_health);
 
        return 1;
 }
@@ -639,7 +639,7 @@ entity Portal_Spawn(entity own, vector org, vector ang)
        portal.takedamage = DAMAGE_AIM;
        portal.event_damage = Portal_Damage;
        portal.fade_time = ((autocvar_g_balance_portal_lifetime >= 0) ? time + autocvar_g_balance_portal_lifetime : 0);
-       SetResourceAmountExplicit(portal, RESOURCE_HEALTH, autocvar_g_balance_portal_health);
+       SetResourceAmount(portal, RESOURCE_HEALTH, autocvar_g_balance_portal_health);
        setmodel(portal, MDL_PORTAL);
        portal.savemodelindex = portal.modelindex;
        setcefc(portal, Portal_Customize);
index 74a0c55788a71a2f19de6accaeaacba47f1c9c3b..2356d8eaf443eb625c5bd1687d18720844a541ad 100644 (file)
@@ -77,17 +77,6 @@ float GetResourceAmount(entity e, int resource_type)
        return e.(resource_field);
 }
 
-bool SetResourceAmountExplicit(entity e, int resource_type, float amount)
-{
-       .float resource_field = GetResourceField(resource_type);
-       if (e.(resource_field) != amount)
-       {
-               e.(resource_field) = amount;
-               return true;
-       }
-       return false;
-}
-
 void SetResourceAmount(entity e, int resource_type, float amount)
 {
        bool forbid = MUTATOR_CALLHOOK(SetResourceAmount, e, resource_type, amount);
@@ -104,9 +93,10 @@ void SetResourceAmount(entity e, int resource_type, float amount)
                amount_wasted = amount - max_amount;
                amount = max_amount;
        }
-       bool changed = SetResourceAmountExplicit(e, resource_type, amount);
-       if (changed)
+       .float resource_field = GetResourceField(resource_type);
+       if (e.(resource_field) != amount)
        {
+               e.(resource_field) = amount;
                MUTATOR_CALLHOOK(ResourceAmountChanged, e, resource_type, amount);
        }
        if (amount_wasted == 0)
index 15433b264fde16ba7b34d98510743ead0accf3b8..a13d4f35ec139eef53a17f8bffc7290ba5ff8c7a 100644 (file)
@@ -21,13 +21,6 @@ float GetResourceLimit(entity e, int resource_type);
 /// \return Current amount of resource the given entity has.
 float GetResourceAmount(entity e, int resource_type);
 
-/// \brief Sets the resource amount of an entity without calling any hooks.
-/// \param[in,out] e Entity to adjust.
-/// \param[in] resource_type Type of the resource (a RESOURCE_* constant).
-/// \param[in] amount Amount of resource to set.
-/// \return Boolean for whether the ammo amount was changed
-bool SetResourceAmountExplicit(entity e, int resource_type, float amount);
-
 /// \brief Sets the current amount of resource the given entity will have.
 /// \param[in,out] e Entity to adjust.
 /// \param[in] resource_type Type of the resource (a RESOURCE_* constant).