fix a possible uninitialized variable return
This commit is contained in:
parent
d642ff463b
commit
fdd3fc232f
1 changed files with 2 additions and 1 deletions
|
@ -1160,7 +1160,8 @@ static int CclSetUnitVariable(lua_State *l)
|
|||
const char *const name = LuaToString(l, 2);
|
||||
int value;
|
||||
if (!strcmp(name, "Player")) {
|
||||
unit->AssignToPlayer(Players[LuaToNumber(l, 3)]);
|
||||
value = LuaToNumber(l, 3);
|
||||
unit->AssignToPlayer(Players[value]);
|
||||
} else if (!strcmp(name, "RegenerationRate")) {
|
||||
value = LuaToNumber(l, 3);
|
||||
unit->Variable[HP_INDEX].Increase = std::min(unit->Variable[HP_INDEX].Max, value);
|
||||
|
|
Loading…
Reference in a new issue