Files @ r12324:6c583236eedf
Branch filter:

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

translators
(svn r16754) -Update from WebTranslator v3.0:
arabic_egypt - 2 changes by kasakg
traditional_chinese - 64 changes by josesun
german - 4 changes by planetmaker
persian - 2 changes by Gajet9
/* $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;
}