mirror of
https://github.com/HerculesWS/Hercules
synced 2026-08-15 12:23:13 -04:00
Fix warning C4702 (unreachable code) in BUILDIN(getbattleflag) by changing the logic to return early
This commit is contained in:
parent
cc8447bdb2
commit
7001950e5c
1 changed files with 2 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue