- took the weapon selection logic out of the WeaponSlots data and blocked all direct access to the weapon slots internals

This seriously needs to be independent from the data store and better abstracted. More work to come to move this to its proper place.
This commit is contained in:
Christoph Oelckers 2018-11-24 22:03:56 +01:00
commit 51ee623b3b
11 changed files with 286 additions and 278 deletions

View file

@ -655,9 +655,9 @@ void player_t::SendPitchLimits() const
bool player_t::HasWeaponsInSlot(int slot) const
{
for (int i = 0; i < weapons.Slots[slot].Size(); i++)
for (int i = 0; i < weapons.SlotSize(slot); i++)
{
PClassActor *weap = weapons.Slots[slot].GetWeapon(i);
PClassActor *weap = weapons.GetWeapon(slot, i);
if (weap != NULL && mo->FindInventory(weap)) return true;
}
return false;