Skip to content

Commit

Permalink
last rename (maybe)
Browse files Browse the repository at this point in the history
also fixed an oopsie int he wrapper (again)
  • Loading branch information
tylerandari13 committed Sep 7, 2023
1 parent 46c6162 commit e21ba75
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/scripting/level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Level_finish(bool win)
}

bool
Level_end_sequence_started()
Level_has_active_sequence()
{
SCRIPT_GUARD_GAMESESSION(false);
return game_session.get_end_sequence();
Expand Down
6 changes: 1 addition & 5 deletions src/scripting/level.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,10 @@ class Level
* @param bool $win If ""true"", the level is marked as completed if launched from a worldmap.
*/
void Level_finish(bool win);
/**
* Returns whether the current level has ended.
*/
bool Level_is_finished();
/**
* Gets whether an end sequence has started. (AKA when the stats at the end are visible)
*/
bool Level_end_sequence_started();
bool Level_has_active_sequence();

/**
* Respawns Tux in sector named ""sector"" at spawnpoint named ""spawnpoint"".${SRG_TABLENEWPARAGRAPH}
Expand Down
12 changes: 6 additions & 6 deletions src/scripting/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12530,11 +12530,11 @@ static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)

}

static SQInteger Level_is_finished_wrapper(HSQUIRRELVM vm)
static SQInteger Level_has_active_sequence_wrapper(HSQUIRRELVM vm)
{

try {
bool return_value = scripting::Level_is_finished();
bool return_value = scripting::Level_has_active_sequence();

sq_pushbool(vm, return_value);
return 1;
Expand All @@ -12543,7 +12543,7 @@ static SQInteger Level_is_finished_wrapper(HSQUIRRELVM vm)
sq_throwerror(vm, e.what());
return SQ_ERROR;
} catch(...) {
sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_is_finished'"));
sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_has_active_sequence'"));
return SQ_ERROR;
}

Expand Down Expand Up @@ -14018,11 +14018,11 @@ void register_supertux_wrapper(HSQUIRRELVM v)
throw SquirrelError(v, "Couldn't register function 'Level_finish'");
}

sq_pushstring(v, "Level_is_finished", -1);
sq_newclosure(v, &Level_is_finished_wrapper, 0);
sq_pushstring(v, "Level_has_active_sequence", -1);
sq_newclosure(v, &Level_has_active_sequence_wrapper, 0);
sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, ".");
if(SQ_FAILED(sq_createslot(v, -3))) {
throw SquirrelError(v, "Couldn't register function 'Level_is_finished'");
throw SquirrelError(v, "Couldn't register function 'Level_has_active_sequence'");
}

sq_pushstring(v, "Level_spawn", -1);
Expand Down

0 comments on commit e21ba75

Please sign in to comment.