Minor bugfixes and improvements

- Updated CarModelConverter fallback to include car id
- Updated PedRemapConverter to cast to uint8_t, not uint32_t
- Added WeaponConverter -1 case
- Added missing returns in ModMenuModule::PlayerAppearanceCheat
- Added logging in ModMenuModule::SavedCarsCheat
- Fixed rare ModMenuModule::MenuManager crash on exit
- Added missing conditional in ModMenuModule::PlayerPosMenu
This commit is contained in:
izawartka 2026-07-21 21:30:59 +02:00
parent b10482f4de
commit 1281a4885c
7 changed files with 12 additions and 7 deletions

View File

@ -91,7 +91,8 @@ public:
case 84: return L"EDSELFBI";
case 85: return L"HOTDOG D4";
case 86: return L"KRSNABUS";
default: return L"???";
default:
return L"VEHICLE " + std::to_wstring(id);
}
}

View File

@ -5,7 +5,7 @@
class PedRemapConverter {
public:
static std::wstring ConvertToString(Game::PED_REMAP value) {
int32_t id = static_cast<int32_t>(value);
int8_t id = static_cast<int8_t>(value);
switch (id) {
case -1: return L"Default";

View File

@ -8,6 +8,7 @@ public:
int32_t id = static_cast<int32_t>(value);
switch (id) {
case -1: return L"None";
case 0: return L"Pistol";
case 1: return L"S-Uzi";
case 2: return L"Rocket Launcher";

View File

@ -218,6 +218,7 @@ void ModMenuModule::PlayerAppearanceCheat::OnPedRemapUpdate(const std::optional<
}
m_resetAndDisableRemapDone = true;
ResetAndDisableCheckAndProceed();
return;
}
m_originalRemap = newValue;
@ -240,6 +241,7 @@ void ModMenuModule::PlayerAppearanceCheat::OnPedGraphicTypeUpdate(const std::opt
}
m_resetAndDisableGraphicTypeDone = true;
ResetAndDisableCheckAndProceed();
return;
}
m_originalGraphicType = newValue;

View File

@ -50,6 +50,7 @@ std::optional<ModMenuModule::SavedCarsCheatEntry> ModMenuModule::SavedCarsCheat:
{
auto it = m_entries.find(name);
if (it == m_entries.end()) {
spdlog::warn("SavedCarsCheat::GetCar: Car not found");
return std::nullopt;
}
return it->second;

View File

@ -51,10 +51,10 @@ void ModMenuModule::MenuManager::RemoveLastMenu()
void ModMenuModule::MenuManager::ClearMenus()
{
std::vector<MenuId> menuIds = m_menuIds;
m_menuIds.clear();
for (MenuId id : menuIds) {
PendingChange change = { ChangeType::Remove, id, nullptr };
while (m_menuIds.size()) {
MenuId lastMenuId = m_menuIds.back();
m_menuIds.pop_back();
PendingChange change = { ChangeType::Remove, lastMenuId, nullptr };
AddPendingChange(change);
}
}

View File

@ -88,6 +88,6 @@ void ModMenuModule::PlayerPosMenu::Teleport()
}
short* rotationPtr = Game::Utils::GetPlayerPedRotationPtr();
*rotationPtr = targetRotation;
if(rotationPtr) *rotationPtr = targetRotation;
});
}