diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp index da07dff5..ef7c8e97 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp @@ -2602,7 +2602,7 @@ void cyMisc::WearMaintainerSuit(pyKey& key, hsBool wear) } -void cyMisc::WearDefaultClothing(pyKey& key) +void cyMisc::WearDefaultClothing(pyKey& key, hsBool broadcast) { if (key.getKey() != plNetClientMgr::GetInstance()->GetLocalPlayerKey()) return; @@ -2611,11 +2611,11 @@ void cyMisc::WearDefaultClothing(pyKey& key) if (avMod) { - avMod->GetClothingOutfit()->WearDefaultClothing(); + avMod->GetClothingOutfit()->WearDefaultClothing(broadcast); } } -void cyMisc::WearDefaultClothingType(pyKey& key, UInt32 type) +void cyMisc::WearDefaultClothingType(pyKey& key, UInt32 type, hsBool broadcast) { if (key.getKey() != plNetClientMgr::GetInstance()->GetLocalPlayerKey()) return; @@ -2624,7 +2624,7 @@ void cyMisc::WearDefaultClothingType(pyKey& key, UInt32 type) if (avMod) { - avMod->GetClothingOutfit()->WearDefaultClothingType(type); + avMod->GetClothingOutfit()->WearDefaultClothingType(type, broadcast); } } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h index 12391023..c2574d28 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h @@ -875,8 +875,8 @@ public: // static void WearMaintainerSuit(pyKey& key, hsBool wear); - static void WearDefaultClothing(pyKey& key); - static void WearDefaultClothingType(pyKey& key, UInt32 type); + static void WearDefaultClothing(pyKey& key, hsBool broadcast = false); + static void WearDefaultClothingType(pyKey& key, UInt32 type, hsBool broadcast = false); ////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp index 0022da44..7df2e1b9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp @@ -598,11 +598,13 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtFakeLinkAvatarToObject, args, "Params: avatar, PYTHON_RETURN_NONE; } -PYTHON_GLOBAL_METHOD_DEFINITION(PtWearDefaultClothingType, args, "Params: key,type\nForces the avatar to wear the default clothing of the specified type") +PYTHON_GLOBAL_METHOD_DEFINITION_WKEY(PtWearDefaultClothingType, args, kw, "Params: key,type,broadcast=false\nForces the avatar to wear the default clothing of the specified type") { + char* kwlist[] = { "broadcast", NULL }; PyObject* keyObj = NULL; unsigned long type; - if (!PyArg_ParseTuple(args, "Ol", &keyObj, &type)) + bool broadcast = false; + if (!PyArg_ParseTupleAndKeywords(args, kw, "Ol|b", kwlist, &keyObj, &type, &broadcast)) { PyErr_SetString(PyExc_TypeError, "PtWearDefaultClothingType expects a ptKey and an unsigned long"); PYTHON_RETURN_ERROR; @@ -613,7 +615,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtWearDefaultClothingType, args, "Params: key,ty PYTHON_RETURN_ERROR; } pyKey* key = pyKey::ConvertFrom(keyObj); - cyMisc::WearDefaultClothingType(*key, type); + cyMisc::WearDefaultClothingType(*key, type, broadcast); PYTHON_RETURN_NONE; } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp index cb6081b2..332d610b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp @@ -529,10 +529,12 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtWearMaintainerSuit, args, "Params: key,wearOrN PYTHON_RETURN_NONE; } -PYTHON_GLOBAL_METHOD_DEFINITION(PtWearDefaultClothing, args, "Params: key\nForces the avatar to wear the default clothing set") +PYTHON_GLOBAL_METHOD_DEFINITION_WKEY(PtWearDefaultClothing, args, kw, "Params: key, broadcast=false\nForces the avatar to wear the default clothing set") { + char* kwlist[] = { "broadcast", NULL }; PyObject* keyObj = NULL; - if (!PyArg_ParseTuple(args, "O", &keyObj)) + bool broadcast = false; + if (!PyArg_ParseTupleAndKeywords(args, kw, "O|b", kwlist, &keyObj, &broadcast)) { PyErr_SetString(PyExc_TypeError, "PtWearDefaultClothing expects a ptKey"); PYTHON_RETURN_ERROR; @@ -543,7 +545,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtWearDefaultClothing, args, "Params: key\nForce PYTHON_RETURN_ERROR; } pyKey* key = pyKey::ConvertFrom(keyObj); - cyMisc::WearDefaultClothing(*key); + cyMisc::WearDefaultClothing(*key, broadcast); PYTHON_RETURN_NONE; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index 37c60df8..9d66b8f1 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -1003,7 +1003,7 @@ void plClothingOutfit::IUpdate() } } -void plClothingOutfit::WearDefaultClothing() +void plClothingOutfit::WearDefaultClothing(hsBool broadcast) { StripAccessories(); @@ -1041,9 +1041,14 @@ void plClothingOutfit::WearDefaultClothing() } } } + + if (broadcast) { + fSynchClients = true; + ForceUpdate(true); + } } -void plClothingOutfit::WearDefaultClothingType(UInt32 clothingType) +void plClothingOutfit::WearDefaultClothingType(UInt32 clothingType, hsBool broadcast) { plClothingMgr *cMgr = plClothingMgr::GetClothingMgr(); hsTArray items; @@ -1072,6 +1077,11 @@ void plClothingOutfit::WearDefaultClothingType(UInt32 clothingType) break; } } + + if (broadcast) { + fSynchClients = true; + ForceUpdate(true); + } } void plClothingOutfit::WearMaintainerOutfit() diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.h index 0f085f6b..42a167ac 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.h @@ -199,8 +199,8 @@ public: hsBool DirtySynchState(const char* SDLStateName, UInt32 synchFlags); void StripAccessories(); - void WearDefaultClothing(); - void WearDefaultClothingType(UInt32 clothingType); + void WearDefaultClothing(hsBool broadcast = false); + void WearDefaultClothingType(UInt32 clothingType, hsBool broadcast = false); void WearMaintainerOutfit(); void WearRandomOutfit(); void RemoveMaintainerOutfit();