]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Fix a bug with picking partly consumed items back up
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 15:11:59 +0000 (17:11 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 15:11:59 +0000 (17:11 +0200)
data/qcsrc/server/t_items.qc

index 092b287d4db21a26b2dc97c474d535f470cef06f..6d9dfadf1cfa4acfb22bf9d72c674e97a6a4ddae 100644 (file)
@@ -315,9 +315,17 @@ void Item_Consumable_Spawn(entity e, entity pl)
        item.solid = SOLID_NOT;\r
        setmodel(item, e.model);\r
        item.health = e.health;\r
-       item.inithealth = e.health;\r
+       if(e.inithealth)\r
+       {\r
+               item.inithealth = e.inithealth;\r
+               item.initdmg = e.initdmg;\r
+       }\r
+       else\r
+       {\r
+               item.inithealth = e.health;\r
+               item.initdmg = e.dmg;\r
+       }\r
        item.max_health = e.max_health;\r
-       item.initdmg = e.dmg;\r
 \r
        item.predator = pl;\r
        item.aiment = pl;\r
@@ -366,8 +374,8 @@ void Item_DroppedConsumable_Spawn(entity e)
        setmodel(item, e.model);\r
        item.health = e.health;\r
        item.inithealth = e.inithealth;\r
-       item.max_health = e.max_health;\r
        item.initdmg = e.initdmg;\r
+       item.max_health = e.max_health;\r
        item.scale = e.scale;\r
        item.colormod = e.colormod;\r
 \r