Browse Source

plArmatureMod => plString

Michael Hansen 11 years ago
parent
commit
ff30c77ddd
  1. 2
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  2. 22
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp
  3. 14
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h
  4. 7
      Sources/Plasma/PubUtilLib/plMessage/plAIMsg.cpp
  5. 6
      Sources/Plasma/PubUtilLib/plMessage/plAIMsg.h

2
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -2919,7 +2919,7 @@ PyObject* cyMisc::GetAIAvatarsByModelName(const char* name)
{ {
PyObject* tuple = PyTuple_New(2); PyObject* tuple = PyTuple_New(2);
PyTuple_SetItem(tuple, 0, pyCritterBrain::New(critterBrain)); PyTuple_SetItem(tuple, 0, pyCritterBrain::New(critterBrain));
PyTuple_SetItem(tuple, 1, PyString_FromString(armMod->GetUserStr())); PyTuple_SetItem(tuple, 1, PyString_FromPlString(armMod->GetUserStr()));
PyList_Append(avList, tuple); PyList_Append(avList, tuple);
Py_DECREF(tuple); Py_DECREF(tuple);

22
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp

@ -1743,8 +1743,8 @@ void plArmatureMod::Write(hsStream *stream, hsResMgr *mgr)
stream->WriteLEFloat(fPhysWidth); stream->WriteLEFloat(fPhysWidth);
stream->WriteSafeString(fAnimationPrefix); stream->WriteSafeString(fAnimationPrefix);
stream->WriteSafeString(fBodyAgeName.c_str()); stream->WriteSafeString(fBodyAgeName);
stream->WriteSafeString(fBodyFootstepSoundPage.c_str()); stream->WriteSafeString(fBodyFootstepSoundPage);
} }
void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr) void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr)
@ -1780,9 +1780,7 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr)
// Attach the Footstep emitter scene object // Attach the Footstep emitter scene object
hsResMgr *mgr = hsgResMgr::ResMgr(); hsResMgr *mgr = hsgResMgr::ResMgr();
const char *age = fBodyAgeName.c_str(); const plLocation &gLoc = plKeyFinder::Instance().FindLocation(fBodyAgeName, fBodyFootstepSoundPage);
const char *page = fBodyFootstepSoundPage.c_str();
const plLocation &gLoc = plKeyFinder::Instance().FindLocation(age, page);
if (gLoc.IsValid()) if (gLoc.IsValid())
{ {
@ -1824,15 +1822,9 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr)
fPhysWidth = stream->ReadLEFloat(); fPhysWidth = stream->ReadLEFloat();
fAnimationPrefix = stream->ReadSafeString_TEMP(); fAnimationPrefix = stream->ReadSafeString_TEMP();
fBodyAgeName = stream->ReadSafeString_TEMP();
fBodyFootstepSoundPage = stream->ReadSafeString_TEMP();
char *temp = stream->ReadSafeString();
fBodyAgeName = temp;
delete [] temp;
temp = stream->ReadSafeString();
fBodyFootstepSoundPage = temp;
delete [] temp;
plgDispatch::Dispatch()->RegisterForExactType(plAvatarStealthModeMsg::Index(), GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plAvatarStealthModeMsg::Index(), GetKey());
} }
@ -2561,9 +2553,9 @@ int plArmatureMod::GetKILevel()
return VaultGetKILevel(); return VaultGetKILevel();
} }
void plArmatureMod::SetLinkInAnim(const char *animName) void plArmatureMod::SetLinkInAnim(const plString &animName)
{ {
if (animName) if (!animName.IsNull())
{ {
plAGAnim *anim = FindCustomAnim(animName); plAGAnim *anim = FindCustomAnim(animName);
fLinkInAnimKey = (anim ? anim->GetKey() : nil); fLinkInAnimKey = (anim ? anim->GetKey() : nil);

14
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.h

@ -340,7 +340,7 @@ public:
bool IsKILowestLevel(); bool IsKILowestLevel();
int GetKILevel(); int GetKILevel();
void SetLinkInAnim(const char *animName); void SetLinkInAnim(const plString &animName);
plKey GetLinkInAnimKey() const; plKey GetLinkInAnimKey() const;
enum enum
@ -369,11 +369,11 @@ public:
void SetPhysicalDims(float height, float width) { fPhysHeight = height; fPhysWidth = width; } void SetPhysicalDims(float height, float width) { fPhysHeight = height; fPhysWidth = width; }
void SetBodyAgeName(const char* ageName) {if (ageName) fBodyAgeName = ageName; else fBodyAgeName = "";} void SetBodyAgeName(const plString& ageName) { fBodyAgeName = ageName; }
void SetBodyFootstepSoundPage(const char* pageName) {if (pageName) fBodyFootstepSoundPage = pageName; else fBodyFootstepSoundPage = "";} void SetBodyFootstepSoundPage(const plString& pageName) { fBodyFootstepSoundPage = pageName; }
void SetAnimationPrefix(const plString& prefix) { fAnimationPrefix = prefix; } void SetAnimationPrefix(const plString& prefix) { fAnimationPrefix = prefix; }
const char* GetUserStr() {return fUserStr.c_str();} plString GetUserStr() const { return fUserStr; }
protected: protected:
void IInitDefaults(); void IInitDefaults();
@ -443,12 +443,12 @@ protected:
bool fDontPanicLink; bool fDontPanicLink;
// strings for animations, age names, footstep sounds, etc // strings for animations, age names, footstep sounds, etc
std::string fBodyAgeName; plString fBodyAgeName;
std::string fBodyFootstepSoundPage; plString fBodyFootstepSoundPage;
plString fAnimationPrefix; plString fAnimationPrefix;
// user-defined string assigned to this avatar // user-defined string assigned to this avatar
std::string fUserStr; plString fUserStr;
}; };
// PLARMATURELOD // PLARMATURELOD

7
Sources/Plasma/PubUtilLib/plMessage/plAIMsg.cpp

@ -68,17 +68,14 @@ void plAIMsg::Read(hsStream* stream, hsResMgr* mgr)
{ {
plMessage::IMsgRead(stream, mgr); plMessage::IMsgRead(stream, mgr);
char* temp = stream->ReadSafeString(); fBrainUserStr = stream->ReadSafeString_TEMP();
if (temp)
fBrainUserStr = temp;
delete [] temp;
} }
void plAIMsg::Write(hsStream* stream, hsResMgr* mgr) void plAIMsg::Write(hsStream* stream, hsResMgr* mgr)
{ {
plMessage::IMsgWrite(stream, mgr); plMessage::IMsgWrite(stream, mgr);
stream->WriteSafeString(fBrainUserStr.c_str()); stream->WriteSafeString(fBrainUserStr);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

6
Sources/Plasma/PubUtilLib/plMessage/plAIMsg.h

@ -63,8 +63,8 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr); virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr); virtual void Write(hsStream* stream, hsResMgr* mgr);
void BrainUserString(const std::string& userStr) {fBrainUserStr = userStr;} void BrainUserString(const plString& userStr) {fBrainUserStr = userStr;}
std::string BrainUserString() const {return fBrainUserStr;} plString BrainUserString() const {return fBrainUserStr;}
// enum for all messages to make things easier for people that use us // enum for all messages to make things easier for people that use us
enum enum
@ -75,7 +75,7 @@ public:
}; };
private: private:
std::string fBrainUserStr; plString fBrainUserStr;
}; };
// message spammed to anyone listening so they can grab the brain's key and talk to it // message spammed to anyone listening so they can grab the brain's key and talk to it

Loading…
Cancel
Save