Skip to content

Commit

Permalink
For non-weapon items respect spawn count value.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neloreck committed Jan 3, 2025
1 parent 4f355fa commit 3ed7c04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/xrGame/alife_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ void CSE_ALifeObject::spawn_supplies(LPCSTR ini_string)
alife().spawn_item(ammoSec, o_Position, m_tNodeID, m_tGraphID, ID);
}
}
// If not weapon item, handle count as literal count, not ammo (useful for grenades and consumables).
else
{
for (u32 i = 1; i <= spawnCount - 1; ++i)
alife().spawn_item(itmSection, o_Position, m_tNodeID, m_tGraphID, ID);
}

if (const auto IItem = smart_cast<CSE_ALifeInventoryItem*>(E))
IItem->m_fCondition = fCond;
}
Expand Down
1 change: 1 addition & 0 deletions src/xrServerEntities/xrServer_Objects_ALife.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class CSE_ALifeObject : public CSE_Abstract, public CRandom
virtual u32 ef_weapon_type() const;
virtual u32 ef_detector_type() const;
#ifdef XRGAME_EXPORTS
virtual bool is_spawn_supplies_flag_set(LPCSTR, LPCSTR);
virtual void spawn_supplies(LPCSTR);
virtual void spawn_supplies();
CALifeSimulator& alife() const;
Expand Down

0 comments on commit 3ed7c04

Please sign in to comment.