mirror of https://github.com/AxioDL/metaforce.git
CGameState: Remove use of const_cast
Same behavior, but nicer to read.
This commit is contained in:
parent
603942daaf
commit
24fe7ec499
|
@ -205,7 +205,7 @@ void CGameState::WriteBackupBuf() {
|
|||
PutTo(w);
|
||||
}
|
||||
|
||||
void CGameState::PutTo(CBitStreamWriter& writer) const {
|
||||
void CGameState::PutTo(CBitStreamWriter& writer) {
|
||||
for (u32 i = 0; i < 128; i++)
|
||||
writer.WriteEncoded(x0_[i], 8);
|
||||
|
||||
|
@ -227,7 +227,7 @@ void CGameState::PutTo(CBitStreamWriter& writer) const {
|
|||
for (const auto& memWorld : memWorlds) {
|
||||
TLockedToken<CSaveWorld> saveWorld =
|
||||
g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), memWorld.second.GetSaveWorldAssetId()});
|
||||
const CWorldState& wld = const_cast<CGameState&>(*this).StateForWorld(memWorld.first);
|
||||
const CWorldState& wld = StateForWorld(memWorld.first);
|
||||
wld.PutTo(writer, *saveWorld);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ public:
|
|||
void SetFileIdx(u32 idx) { x20c_saveFileIdx = idx; }
|
||||
void SetCardSerial(u64 serial) { x210_cardSerial = serial; }
|
||||
u64 GetCardSerial() const { return x210_cardSerial; }
|
||||
void PutTo(CBitStreamWriter& writer) const;
|
||||
void PutTo(CBitStreamWriter& writer);
|
||||
float GetHardModeDamageMultiplier() const;
|
||||
float GetHardModeWeaponMultiplier() const;
|
||||
void InitializeMemoryWorlds();
|
||||
|
|
Loading…
Reference in New Issue