Bazaar developer reference

CustomMods::eventHook(const char *, const char *, ...)

Defined in
CustomMods.cpp, line 16
Class
CustomMods
Not a hook point
variadic

Code

15// I would rather have all of this shit here (where it need never be read more than once) to make the calling of events cleaner in the main code16int CustomMods::eventHook(const char* szName, const char* p, ...) {17	CvLuaArgsHandle args;1819	va_list vl;20	va_start(vl, p);2122	for (const char* it = p; *it; ++it) {23		if (*it == 'b') {24			// It's a boolean25			args->Push(va_arg(vl, bool));26		} else if (*it == 'i') {27			// It's an int28			args->Push(va_arg(vl, int));29		} else {30			// Assume it's a string (char *)31			char* s = va_arg(vl, char*);32			args->Push(s, strlen(s));33			break;34		}35	}3637	va_end(vl);3839	return eventHook(szName, args);40}

Calls

Called by

94 functions in 19 files