mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- added a proper error message when '--' or '++' gets used on 8 or 16 bit values.
This commit is contained in:
parent
f4143f7624
commit
a94f5dd1b3
2 changed files with 5 additions and 5 deletions
|
@ -2145,9 +2145,9 @@ FxExpression *FxPreIncrDecr::Resolve(FCompileContext &ctx)
|
|||
|
||||
ValueType = Base->ValueType;
|
||||
|
||||
if (!Base->IsNumeric())
|
||||
if (!Base->IsNumeric() || Base->ValueType->Size != 4)
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR, "Numeric type expected");
|
||||
ScriptPosition.Message(MSG_ERROR, "Numeric 32 bit type expected");
|
||||
delete this;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -2232,9 +2232,9 @@ FxExpression *FxPostIncrDecr::Resolve(FCompileContext &ctx)
|
|||
|
||||
ValueType = Base->ValueType;
|
||||
|
||||
if (!Base->IsNumeric())
|
||||
if (!Base->IsNumeric() || ValueType->Size != 4)
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR, "Numeric type expected");
|
||||
ScriptPosition.Message(MSG_ERROR, "Numeric 32 bit type expected");
|
||||
delete this;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -406,7 +406,7 @@ class StateProvider : Inventory
|
|||
if ((player.cmd.buttons & BT_ATTACK)
|
||||
&& !player.ReadyWeapon.bAltFire && !pending && player.health > 0)
|
||||
{
|
||||
player.refire++;
|
||||
player.refire = player.refire + 1;
|
||||
player.mo.FireWeapon(ResolveState(flash));
|
||||
}
|
||||
else if ((player.cmd.buttons & BT_ALTATTACK)
|
||||
|
|
Loading…
Reference in a new issue