Fix warning C4702 (unreachable code) in BUILDIN(getbattleflag) by changing the logic to return early

This commit is contained in:
Haru 2026-07-10 01:37:53 +02:00 committed by Ibrahim Zidan
parent cc8447bdb2
commit 7001950e5c
No known key found for this signature in database
GPG key ID: 0F0A43C7FE4C7B9A

View file

@ -18904,15 +18904,13 @@ static BUILDIN(getbattleflag)
flag = script_getstr(st,2);
if (battle->config_get_value(flag, &value)) {
script_pushint(st,value);
return true;
} else {
if (battle->config_get_value(flag, &value) == 0) {
script_pushint(st,0);
ShowWarning("buildin_getbattleflag: non-exist battle config requested %s \n", flag);
return false;
}
script_pushint(st,value);
return true;
}