1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-21 12:49:10 +00:00

Track NPC clones

Manual state management in python was kind of fiddly, so let's track all
avatar clones in the NetApp and unload them as needed. This also seems to
fix a potential bug in plNPCSpawnMod (is that even used?).
This commit is contained in:
2012-05-06 19:22:03 -04:00
parent b8b8e6d730
commit 3b69a4aee3
10 changed files with 89 additions and 54 deletions

View File

@ -153,7 +153,7 @@ private:
// cached char info
plKey fLocalPlayerKey;
plKeyVec fRemotePlayerKeys;
// plKeyVec fNPCKeys;
plKeyVec fNPCKeys;
class plNetClientMgrMsg * fDisableMsg;
@ -222,6 +222,7 @@ private:
void IRemoveCloneRoom();
void IUnloadRemotePlayers();
void IUnloadNPCs();
plKey ILoadClone(plLoadCloneMsg *cloneMsg);
@ -309,9 +310,15 @@ public:
// avatar vault actions
int UploadPlayerVault(uint32_t vaultFlags);
// npc clones
const plKeyVec& NPCKeys() const { return fNPCKeys; }
plSynchedObject* GetNPC(uint32_t i) const;
void AddNPCKey(const plKey& npc);
bool IsNPCKey(const plKey& npc, int* idx=nil) const;
// remote players
const std::vector<plKey>& RemotePlayerKeys() const { return fRemotePlayerKeys; }
const plKeyVec& RemotePlayerKeys() const { return fRemotePlayerKeys; }
plSynchedObject* GetRemotePlayer(int i) const;
void AddRemotePlayerKey(plKey p);
hsBool IsRemotePlayerKey(const plKey p, int* idx=nil);