1
0
Fork 0

Codefix b2c5712: [Script] Properly check sq_instanceof return value (#13657)

pull/13658/head
Loïc Guilloux 2025-02-24 22:09:04 +01:00 committed by GitHub
parent 02f040b22a
commit c06f5cff09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -517,7 +517,7 @@ bool Squirrel::CreateClassInstance(const std::string &class_name, void *real_ins
sq_pushstring(vm, class_name);
sq_get(vm, -2);
sq_push(vm, index);
if (sq_instanceof(vm)) {
if (sq_instanceof(vm) == SQTrue) {
sq_pop(vm, 3);
SQUserPointer ptr = nullptr;
if (SQ_SUCCEEDED(sq_getinstanceup(vm, index, &ptr, nullptr))) return ptr;