aboutsummaryrefslogtreecommitdiff
path: root/src/script.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2026-06-20 21:49:39 -0300
committerfusion32 <marcopuzziello@gmail.com>2026-06-20 21:50:45 -0300
commit386fa9b8078a1b32187dfcbfc2a0ed7543e16346 (patch)
tree54fe26deea146afaa628d89e8e6ce95f3aaca1f7 /src/script.cc
parenta8d26b6ce32066812fd46ac88804048d38218db3 (diff)
downloadgame-386fa9b8078a1b32187dfcbfc2a0ed7543e16346.tar.gz
game-386fa9b8078a1b32187dfcbfc2a0ed7543e16346.zip
minor tweak to script recursion depth checks
Diffstat (limited to 'src/script.cc')
-rw-r--r--src/script.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script.cc b/src/script.cc
index 4695acc..6f0c826 100644
--- a/src/script.cc
+++ b/src/script.cc
@@ -92,7 +92,7 @@ TReadScriptFile::~TReadScriptFile(void){
void TReadScriptFile::open(const char *FileName){
int Depth = this->RecursionDepth + 1;
- if((Depth + 1) >= NARRAY(this->File)){
+ if(Depth >= NARRAY(this->File)){
::error("TReadScriptFile::open: Rekursionstiefe zu groß.\n");
throw "Recursion depth too high";
}
@@ -139,7 +139,7 @@ void TReadScriptFile::close(void){
void TReadScriptFile::error(const char *Text){
int Depth = this->RecursionDepth;
- ASSERT(Depth >= 0 && Depth <= NARRAY(this->File));
+ ASSERT(Depth >= 0 && Depth < NARRAY(this->File));
const char *Filename = this->Filename[Depth];
if(const char *Slash = findLast(this->Filename[Depth], '/')){