diff --git a/Source/Client/Mode/GameModeProtocol.cpp b/Source/Client/Mode/GameModeProtocol.cpp index ad98a5d89..fdff3639e 100644 --- a/Source/Client/Mode/GameModeProtocol.cpp +++ b/Source/Client/Mode/GameModeProtocol.cpp @@ -20,13 +20,17 @@ void DecodeSrcDst(const unsigned char* packed, int* srcX, int* srcY, int* dstX, // OFFSET: 0x00D08600 // FUNCTION: fn_21589 void SendPacketHeader(std::uint16_t packetType) { - std::uint16_t packet = packetType; - GetRagConnection().Send(sizeof(packet), &packet); + std::uint16_t packet[1]; + packet[0] = packetType; + GetRagConnection().Send(sizeof(packet), packet); } + // OFFSET: 0x00D08620 // FUNCTION: fn_21590 void SendPacketHeader2(std::uint16_t packetType) { - std::uint16_t packet = packetType; - GetRagConnection().Send(sizeof(packet), &packet); + std::uint16_t packet[1]; + packet[0] = packetType; + GetRagConnection().Send(sizeof(packet), packet); } + diff --git a/Source/Contents/Actors/Player.cpp b/Source/Contents/Actors/Player.cpp index d92da4d44..53bfd28cd 100644 --- a/Source/Contents/Actors/Player.cpp +++ b/Source/Contents/Actors/Player.cpp @@ -536,12 +536,13 @@ bool CPlayer::IsSpecialState(int state) const { // FUNCTION: fn_22619 void CGrannyPc::Slot39(int value) { if (this->unknown_0440 != 11 || this->unknown_0444 != 0) { - value = std::min(value, g_maxMoveSpeed); + value = value > g_maxMoveSpeed ? g_maxMoveSpeed : value; } this->render.unknown_0064 = static_cast(value) / 432.0f; } + // OFFSET: 0x00DB0710 // FUNCTION: fn_22620 void CPc::Slot39(int value) { diff --git a/Source/Contents/AdventureGuideMgr.cpp b/Source/Contents/AdventureGuideMgr.cpp index 6ff331a59..a8c2f7a50 100644 --- a/Source/Contents/AdventureGuideMgr.cpp +++ b/Source/Contents/AdventureGuideMgr.cpp @@ -463,14 +463,15 @@ int InsertQuestSubMenu(lua_State* state) { if (!result.ok) { lua_pushboolean(state, 0); lua_pushstring(state, FormatString("InsertQuestSubMenu : %s", result.message.c_str())); - } else { - lua_pushboolean(state, 1); - lua_pushstring(state, "good"); + return 2; } + lua_pushboolean(state, 1); + lua_pushstring(state, "good"); return 2; } + // OFFSET: 0x0066AF10 // FUNCTION: fn_05284 int InsertQuestContents(lua_State* state) { @@ -558,14 +559,15 @@ int InsertQuestReward(lua_State* state) { if (!result.ok) { lua_pushboolean(state, 0); lua_pushstring(state, FormatString("InsertQuestReward : %s", result.message.c_str())); - } else { - lua_pushboolean(state, 1); - lua_pushstring(state, "good"); + return 2; } + lua_pushboolean(state, 1); + lua_pushstring(state, "good"); return 2; } + // OFFSET: 0x00668EA0 // FUNCTION: fn_05270 int InsertDungeon(lua_State* state) { @@ -815,14 +817,15 @@ int InsertWeaponSubMenu(lua_State* state) { if (!result.ok) { lua_pushboolean(state, 0); lua_pushstring(state, FormatString("InsertWeaponSubMenu : %s", result.message.c_str())); - } else { - lua_pushboolean(state, 1); - lua_pushstring(state, "good"); + return 2; } + lua_pushboolean(state, 1); + lua_pushstring(state, "good"); return 2; } + // OFFSET: 0x0066B810 // FUNCTION: fn_05288 int InsertWeaponContents(lua_State* state) { @@ -887,14 +890,15 @@ int InsertWeaponContents(lua_State* state) { if (!result.ok) { lua_pushboolean(state, 0); lua_pushstring(state, FormatString("InsertWeaponContents : %s", result.message.c_str())); - } else { - lua_pushboolean(state, 1); - lua_pushstring(state, "good"); + return 2; } + lua_pushboolean(state, 1); + lua_pushstring(state, "good"); return 2; } + // OFFSET: 0x0066BB10 // FUNCTION: fn_05289 int InsertWeaponObtainGuide(lua_State* state) { @@ -917,14 +921,15 @@ int InsertWeaponObtainGuide(lua_State* state) { if (!result.ok) { lua_pushboolean(state, 0); lua_pushstring(state, FormatString("InsertWeaponObtainGuide : %s", result.message.c_str())); - } else { - lua_pushboolean(state, 1); - lua_pushstring(state, "good"); + return 2; } + lua_pushboolean(state, 1); + lua_pushstring(state, "good"); return 2; } + // OFFSET: 0x00668550 // FUNCTION: fn_05266 int InsertArmor(lua_State* state) { diff --git a/Source/Contents/Effects/AxeBoomerang.cpp b/Source/Contents/Effects/AxeBoomerang.cpp index c9a3d3217..2ab2d198a 100644 --- a/Source/Contents/Effects/AxeBoomerang.cpp +++ b/Source/Contents/Effects/AxeBoomerang.cpp @@ -127,8 +127,9 @@ void CAxeBoomerang::Slot03() { // OFFSET: 0x006F63F0 // FUNCTION: fn_06843 void CAxeBoomerang::Slot04() { - if (this->unknown_00CC) { + CEZ2STRParticle* particle = reinterpret_cast(this->unknown_00CC); + if (particle) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - reinterpret_cast(this->unknown_00CC)->DrawScreen(mode->camera->frame.view); + particle->DrawScreen(mode->camera->frame.view); } } diff --git a/Source/UI/Buttons/UIBitmapButton.cpp b/Source/UI/Buttons/UIBitmapButton.cpp index 223cd23bd..4fafd73c9 100644 --- a/Source/UI/Buttons/UIBitmapButton.cpp +++ b/Source/UI/Buttons/UIBitmapButton.cpp @@ -57,7 +57,7 @@ void UIBitmapButton::Paint() { break; } - if (this->m_disabled != 0 && !this->m_names[3].empty()) { + if (this->m_disabled != 0 && this->m_names[3].size() > 0) { bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_names[3].c_str()))); } @@ -66,3 +66,4 @@ void UIBitmapButton::Paint() { this->parent->Invalidate(); } } +