OrderOfThePorcupine / ProjectPorcupine

Project Porcupine: A Base-Building Game...in Space!
GNU General Public License v3.0
296 stars 90 forks source link

Fixed neq comparisons (!= to ~=) in `Furniture.lua` #242

Closed BraedonWooding closed 5 years ago

BraedonWooding commented 5 years ago

As the title says fixes it by changing the comparisons

NogginBops commented 5 years ago

Did this code ever work? Or is it Moonsharp that just allowed us to do this?

BraedonWooding commented 5 years ago

That is the weird thing, I can't find any source that it allows it and in the list of differences here it doesn't list it as an allowed operation (it definitely isn't in LUA)

It should have error'd out to be frank, perhaps it allows it but doesn't document it? I'm going to look into it before I merge this.

BraedonWooding commented 5 years ago

Okay despite there being no documentation on it I have found the answer in the source code (nothing like searching through some source code for undocumented features).

The answer is that it changes != to ~= when parsing (it literally changes the token as you can see on this line).

This doesn't mean honestly that this shouldn't be merged, I would still count using != as a bug since;

NogginBops commented 5 years ago

Yeah, this seems like a good change to me.