Expose getDifficulty() to scripting

This commit is contained in:
3risian 2020-05-23 11:40:58 +10:00 committed by GitHub
parent 68aa1c3346
commit 712854b33a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,6 +179,15 @@ namespace Scripting
{
return RaceManager::get()->getReverseTrack();
}
/**
* Gets the difficulty setting for this race.
* @return A Difficulty enum as defined in race_manager.hpp, implicitly casted to an int
*/
int getDifficulty()
{
return RaceManager::get()->getDifficulty();
}
int getMajorRaceMode()
{
@ -571,6 +580,10 @@ namespace Scripting
r = engine->RegisterGlobalFunction("bool isReverse()",
mp ? WRAP_FN(isTrackReverse) : asFUNCTION(isTrackReverse),
call_conv); assert(r >= 0);
r = engine->RegisterGlobalFunction("int getDifficulty()",
mp ? WRAP_FN(getDifficulty) : asFUNCTION(getDifficulty),
call_conv); assert(r >= 0);
r = engine->RegisterGlobalFunction("int getMajorRaceMode()",
mp ? WRAP_FN(getMajorRaceMode) : asFUNCTION(getMajorRaceMode),