Files @ r12114:e7a5a447d429
Branch filter:

Location: cpp/openttd-patchpack/source/src/cheat.cpp

translators
(svn r16533) -Update: WebTranslator2 update to 2009-06-07 17:45:47
icelandic - 8 fixed, 50 changed by scrooge (58)
russian - 8 fixed, 28 changed by Lone Wolf (36)
serbian - 100 fixed by etran (100)
/* $Id$ */

/** @file cheat.cpp Handling (loading/saving/initializing) of cheats. */

#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 */
	const Cheat *cht = (Cheat*)&_cheats;
	const Cheat *cht_last = &cht[sizeof(_cheats) / sizeof(Cheat)];

	for (; cht != cht_last; cht++) {
		if (cht->been_used) return true;
	}

	return false;
}