Project

General

Profile

Bug #3744

"Greater/lesser or equal" operators are not parsed when their signs are swapped

Added by Alexei Dobrohotov 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Scripting
Target version:
Start date:
02/11/2017
% Done:

0%

Reproducibility:
Always
Operating system:
Windows
Severity:
Normal

Description

The main script of the latest R14 version of Mastering Magicka mod uses lesser or equal operator (<=) with swapped signs (=<) on the 215th line which OpenMW cannot parse and thus fails to compile the script ("unexpected < sign"). Although presumable typo, this "spelling" of the operator works fine in the original engine according to the mod author.

Same goes for >= and =>; only the first "spelling" works.

OpenMW-CS considers => and =< erroneous too.

MasteringMagicka.esp - For convenience of testing (71.1 KB) Alexei Dobrohotov, 02/11/2017 01:00 PM

Associated revisions

Revision e095817a (diff)
Added by R. D. 5 months ago

Treat =< and => as == in scripts

(Fixes #3744)

History

#1 Updated by scrawl . 7 months ago

works fine in the original engine according to the mod author.

Have you independently confirmed that? It might work for their uses but for all we know "=>" might have the same effect as "=".

#2 Updated by R. D. 5 months ago

  • Status changed from New to Resolved

Confirmed that OpenMW doesn't accept =< or => and PR to fix it submitted.

From what I saw in my own testing, both of these are treated as by original Morrowind.

I also tried =, which is treated as and already supported in OpenMW.

I don't know if other things after the = are also ignored, but I tried putting an "a" after it, like =a, and that caused an error in original Morrowind, as did putting a question mark like =?. So I only know that ==, =<, => and = are all accepted as "equals."

#3 Updated by R. D. 5 months ago

both of these are treated as by original Morrowind.

both of these are treated as == by original Morrowind.

#4 Updated by R. D. 5 months ago

Actually maybe I was a little hasty. Do we want to fix this? I assumed yes.

#5 Updated by Andrei Kortunov 5 months ago

Problematic code in MM_Main_scpt script:

Set PlayerWillpowerBonus to ( ( Player->GetWillpower ) - MM_PCWillpowerMin )
If ( PlayerWillpowerBonus =< 0 )
    Set PlayerWillpowerBonus to 0
EndIf
If ( MM_PCWillpowerRegen > 0 )
    Set WillpowerMod to ( PlayerWillpowerBonus / MM_PCWillpowerRegen )
EndIf

I think that by design "=<" supposed to work as "<=" (to disable mana regeneration when Player->GetWillpower < MM_PCWillpowerMin), not as "==".
If so, there is a bug in plugin itself.

I think we should keep a warning at least to complain about possible misunderstanding.

#6 Updated by Andrei Kortunov 5 months ago

"by design" == "by plugin design".

#7 Updated by R. D. 5 months ago

Yeah I was thinking that, too. Maybe interpret =< as for compatibility, but give a warning. Anyone who typed =< or => surely meant <= or >=, not .

#8 Updated by R. D. 5 months ago

"==" (without quotes) disappears when I type it here.

interpret =< as for compatibility

interpret =< as "==" for compatibility

#9 Updated by Andrei Kortunov 5 months ago

interpret =< as == for compatibility, but give a warning

A good suggestion, as for me.

#10 Updated by Alexei Dobrohotov 5 months ago

  • Status changed from Resolved to Closed
  • Assignee set to R. D.
  • Target version set to openmw-0.43

Also available in: Atom PDF