Save/load: Add extra cheats savegame chunk
This commit is contained in:
@@ -10,15 +10,23 @@
|
||||
#include "stdafx.h"
|
||||
#include "cheat_type.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
/** All the cheats. */
|
||||
Cheats _cheats;
|
||||
ExtraCheats _extra_cheats;
|
||||
|
||||
std::map<std::string, Cheat> _unknown_cheats;
|
||||
|
||||
/** Reinitialise all the cheats. */
|
||||
void InitializeCheats()
|
||||
{
|
||||
memset(&_cheats, 0, sizeof(Cheats));
|
||||
memset(&_extra_cheats, 0, sizeof(ExtraCheats));
|
||||
_unknown_cheats.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,5 +43,12 @@ bool CheatHasBeenUsed()
|
||||
if (cht->been_used) return true;
|
||||
}
|
||||
|
||||
cht = (Cheat*)&_extra_cheats;
|
||||
cht_last = &cht[sizeof(_extra_cheats) / sizeof(Cheat)];
|
||||
|
||||
for (; cht != cht_last; cht++) {
|
||||
if (cht->been_used) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user