2008-04-17 21:21:01 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file cheat.cpp Handling (loading/saving/initializing) of cheats. */
|
2008-04-17 21:21:01 +00:00
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "cheat_type.h"
|
|
|
|
|
|
|
|
Cheats _cheats;
|
|
|
|
|
|
|
|
void InitializeCheats()
|
|
|
|
{
|
|
|
|
memset(&_cheats, 0, sizeof(Cheats));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CheatHasBeenUsed()
|
|
|
|
{
|
|
|
|
/* Cannot use lengthof because _cheats is of type Cheats, not Cheat */
|
2009-01-10 00:31:47 +00:00
|
|
|
const Cheat *cht = (Cheat*)&_cheats;
|
|
|
|
const Cheat *cht_last = &cht[sizeof(_cheats) / sizeof(Cheat)];
|
2008-04-17 21:21:01 +00:00
|
|
|
|
|
|
|
for (; cht != cht_last; cht++) {
|
|
|
|
if (cht->been_used) return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|