Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Jan 22, 2025
2 parents 3731d81 + c60f8a2 commit b50a68c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion Client/game_sa/CBuildingsPoolSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "CPtrNodeSingleListSA.h"
#include "MemSA.h"
#include "CVehicleSA.h"
#include "CBuildingRemovalSA.h"

extern CGameSA* pGame;

Expand Down Expand Up @@ -174,6 +175,9 @@ void CBuildingsPoolSA::RestoreBackup()
if (!m_pOriginalBuildingsBackup)
return;

auto* worldSA = pGame->GetWorld();
auto* buildingRemovealSA = static_cast<CBuildingRemovalSA*>(pGame->GetBuildingRemoval());

auto& originalData = *m_pOriginalBuildingsBackup;
auto pBuildsingsPool = (*m_ppBuildingPoolInterface);
for (size_t i = 0; i < MAX_BUILDINGS; i++)
Expand All @@ -184,7 +188,8 @@ void CBuildingsPoolSA::RestoreBackup()
auto pBuilding = pBuildsingsPool->GetObject(i);
*pBuilding = originalData[i].second;

pGame->GetWorld()->Add(pBuilding, CBuildingPool_Constructor);
worldSA->Add(pBuilding, CBuildingPool_Constructor);
buildingRemovealSA->AddDataBuilding(pBuilding);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CHudSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ void __fastcall CHudSA::RenderWeaponIcon_Sprite(void* sprite, void*, CRect* rect
color->a = properties.fillColorSecondary.a;

// Call CSprite2d::Draw
((void(__thiscall*)(void*, CRect*, RwColor*))FUNC_CSprie2d_Draw)(sprite, rect, color);
((void(__thiscall*)(void*, CRect*, RwColor*))FUNC_CSprite2d_Draw)(sprite, rect, color);
}

void CHudSA::RenderWeaponIcon_XLU(CVector pos, CVector2D halfSize, std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint16_t intensity, float rhw, std::uint8_t a, std::uint8_t uDir, std::uint8_t vDir)
Expand Down
2 changes: 1 addition & 1 deletion Client/game_sa/CHudSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

#define FUNC_CStats_GetFatAndMuscleModifier 0x559AF0
#define FUNC_CSprite2d_DrawBarChart 0x728640
#define FUNC_CSprie2d_Draw 0x728350
#define FUNC_CSprite2d_Draw 0x728350
#define FUNC_CSprite_RenderOneXLUSprite 0x70D000

#define CODE_ShowMoney 0x58F47D
Expand Down
4 changes: 2 additions & 2 deletions Server/mods/deathmatch/logic/luadefs/CLuaTeamDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ std::uint32_t CLuaTeamDefs::CountPlayersInTeam(CTeam* team) noexcept
return team->CountPlayers();
}

bool CLuaTeamDefs::SetPlayerTeam(CPlayer* player, CTeam* team) noexcept
bool CLuaTeamDefs::SetPlayerTeam(CPlayer* player, std::optional<CTeam*> team) noexcept
{
return CStaticFunctionDefinitions::SetPlayerTeam(player, team);
return CStaticFunctionDefinitions::SetPlayerTeam(player, team.value_or(nullptr));
}

bool CLuaTeamDefs::SetTeamName(CTeam* team, const std::string name)
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/luadefs/CLuaTeamDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CLuaTeamDefs : public CLuaDefs
static std::uint32_t CountPlayersInTeam(CTeam* team) noexcept;

// Team set funcs
static bool SetPlayerTeam(CPlayer* player, CTeam* team) noexcept;
static bool SetPlayerTeam(CPlayer* player, std::optional<CTeam*> team) noexcept;
static bool SetTeamName(CTeam* team, const std::string name);
static bool SetTeamColor(CTeam* team, const std::uint8_t red, const std::uint8_t green, const std::uint8_t blue) noexcept;
static bool SetTeamFriendlyFire(CTeam* team, const bool state) noexcept;
Expand Down

0 comments on commit b50a68c

Please sign in to comment.