]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use StartItem on monster's dropped items instead of referencing spawn functions
authorMario <mario@smbclan.net>
Fri, 24 Feb 2017 10:04:39 +0000 (20:04 +1000)
committerMario <mario@smbclan.net>
Fri, 24 Feb 2017 10:05:23 +0000 (20:05 +1000)
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/sv_instagib.qc
qcsrc/server/mutators/events.qh

index 39f4982309785be35ee8f68a3dc83f1458f7de18..251b1edc7ac786c27dde2df73c0e67b915c1ea12 100644 (file)
@@ -450,7 +450,6 @@ METHOD(Mage, mr_anim, bool(Mage this, entity actor))
 #endif
 #ifdef SVQC
 .float speed;
-spawnfunc(item_health_big);
 METHOD(Mage, mr_setup, bool(Mage this, entity actor))
 {
     TC(Mage, this);
@@ -460,7 +459,7 @@ METHOD(Mage, mr_setup, bool(Mage this, entity actor))
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_mage_speed_stop); }
     if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_mage_damageforcescale); }
 
-    actor.monster_loot = spawnfunc_item_health_big;
+    actor.monster_loot = ITEM_HealthBig;
     actor.monster_attackfunc = M_Mage_Attack;
 
     return true;
index 6baa4534754e499164665095255cc8a580256104..a5863623ecac3217e4ff92d038fa5b3fdaffd669 100644 (file)
@@ -244,7 +244,6 @@ METHOD(Shambler, mr_anim, bool(Shambler this, entity actor))
 }
 #endif
 #ifdef SVQC
-spawnfunc(item_health_mega);
 .float animstate_endtime;
 METHOD(Shambler, mr_setup, bool(Shambler this, entity actor))
 {
@@ -256,7 +255,7 @@ METHOD(Shambler, mr_setup, bool(Shambler this, entity actor))
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_shambler_speed_stop); }
     if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_shambler_damageforcescale); }
 
-    actor.monster_loot = spawnfunc_item_health_mega;
+    actor.monster_loot = ITEM_HealthMega;
     actor.weapon = WEP_ELECTRO.m_id; // matches attacks better than WEP_VORTEX
 
     setanim(actor, actor.anim_shoot, false, true, true);
index 8c90ade8a4c0f3c41bd1fd46edebce68667c0285..7ec7f95acb3ba9e17bb128dab4d41921bff18b69 100644 (file)
@@ -228,7 +228,6 @@ METHOD(Spider, mr_anim, bool(Spider this, entity actor))
 }
 #endif
 #ifdef SVQC
-spawnfunc(item_health_medium);
 METHOD(Spider, mr_setup, bool(Spider this, entity actor))
 {
     TC(Spider, this);
@@ -238,7 +237,7 @@ METHOD(Spider, mr_setup, bool(Spider this, entity actor))
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_spider_speed_stop); }
     if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_spider_damageforcescale); }
 
-    actor.monster_loot = spawnfunc_item_health_medium;
+    actor.monster_loot = ITEM_HealthMedium;
     actor.monster_attackfunc = M_Spider_Attack;
 
     return true;
index 92a098abf2d0c2040522c88f8b6b8e3e620b1bb1..b4a76c99f1fb73e6d4011f65bf0b44a9001dff43 100644 (file)
@@ -148,7 +148,6 @@ METHOD(Wyvern, mr_anim, bool(Wyvern this, entity actor))
 }
 #endif
 #ifdef SVQC
-spawnfunc(item_cells);
 METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor))
 {
     TC(Wyvern, this);
@@ -158,7 +157,7 @@ METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor))
     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_wyvern_speed_stop); }
     if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_wyvern_damageforcescale); }
 
-    actor.monster_loot = spawnfunc_item_cells;
+    actor.monster_loot = ITEM_Cells;
     actor.monster_attackfunc = M_Wyvern_Attack;
 
     return true;
index d9f866e9d145f205b74f8041a581c1d054250fc2..6893d31b67c46baf8990eed25a60460743bad978 100644 (file)
@@ -192,7 +192,7 @@ METHOD(Zombie, mr_setup, bool(Zombie this, entity actor))
 
     actor.spawnflags |= MONSTER_RESPAWN_DEATHPOINT;
 
-    actor.monster_loot = spawnfunc_item_health_medium;
+    actor.monster_loot = ITEM_HealthMedium;
     actor.monster_attackfunc = M_Zombie_Attack;
     actor.spawnshieldtime = actor.spawn_time;
     actor.respawntime = 0.2;
index 3e90b07e4716b62b0a9fd4603afe2c6890c5eca3..94acdd28b59267b81cbed1d7f9ac1fb5f9758385 100644 (file)
@@ -46,7 +46,7 @@ void monster_dropitem(entity this, entity attacker)
        if(e && e.monster_loot)
        {
                e.noalign = true;
-               e.monster_loot(e);
+               StartItem(e, e.monster_loot);
                e.gravity = 1;
                set_movetype(e, MOVETYPE_TOSS);
                e.reset = SUB_Remove;
index 65b7b5256e2bf7193c978b3690a482347fbff2c5..eab41c586558697a66747ad26d8763955fddfc9a 100644 (file)
@@ -137,7 +137,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterDropItem)
 {
        entity item = M_ARGV(1, entity);
 
-       item.monster_loot = spawnfunc_item_minst_cells;
+       item.monster_loot = ITEM_VaporizerCells;
 }
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterSpawn)
index 2d32dc966a32f375c726888f7f4bcda3d0c69228..7f30dbba8b747a5d15320e91eeb2f95a3f7d7cd7 100644 (file)
@@ -294,7 +294,7 @@ MUTATOR_HOOKABLE(MonsterRespawn, EV_MonsterRespawn);
     /**/                                   o(entity, MUTATOR_ARGV_1_entity) \
     /* attacker */                         i(entity, MUTATOR_ARGV_2_entity) \
     /**/
-.void(entity this) monster_loot;
+.entity monster_loot;
 MUTATOR_HOOKABLE(MonsterDropItem, EV_MonsterDropItem);
 
 /**