mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-12 12:08:00 +01:00
utils: PopTransform: Guard against negative indexes
This commit is contained in:
parent
84c56bb12b
commit
ca1cbc19b7
1 changed files with 4 additions and 0 deletions
|
@ -673,6 +673,10 @@ SYMBOL_EXPORT void PushTransform(struct Game* game, ALLEGRO_TRANSFORM* t) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SYMBOL_EXPORT void PopTransform(struct Game* game) {
|
SYMBOL_EXPORT void PopTransform(struct Game* game) {
|
||||||
|
if (game->_priv.transforms_no == 0) {
|
||||||
|
PrintConsole(game, "Tried to pop a non-existent transform!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
al_use_transform(&game->_priv.transforms[--game->_priv.transforms_no]);
|
al_use_transform(&game->_priv.transforms[--game->_priv.transforms_no]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue