Yeah having one big solution w/ all the projs can be pretty nice 8)
So, did you FIGURE OUT THE PROBLEM, friend?
Yes, the item is not in the inventory (pItem == nullptr). I believe this has to do with the way ZPostRequestTakeoffItem and ZPostRequestEquipItem work.
I am re-implementing room tags that have been released on RZ to get used to the GunZ Source. What I'm currently coding are room tags using
this release as reference.) I believe this code is faulty; while it
seems to work, it actually does not do what you expect it to.
I'm not too knowledgable on clientsided/serversides, but my hunch is that it only removes the item clientsided (the return false statement). Serversided, TakeoffItem actually only takes off the item
after you leave the room, not before as you would expect. This creates the illusion that the code is working properly.
I tested this by trying it out with, and without the ZPRTakeoffItem. Even if ZPRTakeoffItem is not called, when joining the room, the player will not have that item equipped. The roomtag seems to work fine.
However, the difference is seen only when you leave the room. Without ZPRTakeoffItem, the player will still have the ''removed'' item equipped. With calling ZPRTakeoffItem, the item will actually be unequipped.
However, I still get an "Not in inventory" error. This means that between when ZPREquipItem is called on OnStageLeave, the item is not in the inventory. Ergo, ZPRTakeoffItem has not taken off the item yet.
In short, this is the order that takes place:
1. Player joins room
2. ZCharacterItem::EquipItem is called. ZPRTakeoffItem is called.
3. ZCharItem::EquipItem returns false (room modifier)
4. Player is in the room
5. Player leaves room
6. OnStageLeave is called, ZPREquipItem is called.
7. OnStageLeave returns
8. ZPREquipItem returns with error: item not in inventory.
9. ZPRTakeoffItem returns and removes item to inventory.