Skip to content

Commit

Permalink
#343: Fix reset impersonation crash (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
cddjr committed Apr 9, 2022
1 parent 8406b6d commit 9b06b41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rpc/RpcPlayerAppearance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

RpcSetPet::RpcSetPet(String* petId)
{
this->PetId = petId;
this->PetId = petId ? petId : convert_to_string("0");
}

void RpcSetPet::Process()
Expand All @@ -14,7 +14,7 @@ void RpcSetPet::Process()

RpcSetSkin::RpcSetSkin(String* skinId)
{
this->SkinId = skinId;
this->SkinId = skinId ? skinId : convert_to_string("0");
}

void RpcSetSkin::Process()
Expand All @@ -24,7 +24,7 @@ void RpcSetSkin::Process()

RpcSetHat::RpcSetHat(String* hatId)
{
this->HatId = hatId;
this->HatId = hatId ? hatId : convert_to_string("0");
}

void RpcSetHat::Process()
Expand All @@ -34,7 +34,7 @@ void RpcSetHat::Process()

RpcSetVisor::RpcSetVisor(String* visorId)
{
this->VisorId = visorId;
this->VisorId = visorId ? visorId : convert_to_string("");
}

void RpcSetVisor::Process()
Expand All @@ -44,7 +44,7 @@ void RpcSetVisor::Process()

RpcSetNamePlate::RpcSetNamePlate(String* namePlateId)
{
this->NamePlateId = namePlateId;
this->NamePlateId = namePlateId ? namePlateId : convert_to_string("");
}

void RpcSetNamePlate::Process()
Expand Down
4 changes: 4 additions & 0 deletions user/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ void SaveOriginalAppearance()
State.originalPet = outfit->fields.PetId;
State.originalColor = outfit->fields.ColorId;
State.activeImpersonation = false;
State.originalVisor = outfit->fields.VisorId;
State.originalNamePlate = outfit->fields.NamePlateId;
}

void ResetOriginalAppearance()
Expand All @@ -714,6 +716,8 @@ void ResetOriginalAppearance()
State.originalHat = nullptr;
State.originalPet = nullptr;
State.originalColor = 0xFF;
State.originalVisor = nullptr;
State.originalNamePlate = nullptr;
}

GameData_PlayerOutfit* GetPlayerOutfit(GameData_PlayerInfo* player, bool includeShapeshifted) {
Expand Down

0 comments on commit 9b06b41

Please sign in to comment.