Fixed [2.1.15] Colors 0, -1, and ? do random silly things. (Also random Blue Knuckles bug)

Status
Not open for further replies.
Code:
addHook("ThinkFrame", do
    for player in players.iterate
        player.mo.color = 0
        player.color = 0
    end
end)
Forcefully setting these to zero does odd stuff.
e15bc91105.png


Color -1 is even worse. That's totally "Blue" right there.

cc8c1e8229.png


Then I got the idea of being able to force my color on the fly and made this.

Code:
COM_AddCommand("forcecolor", function(p, newcolor)
    p.mo.color = tonumber(newcolor)
    p.color = tonumber(newcolor)
end, 1)
So I decided to pay around and see what else is broken. And, interesting stuff happened.

883c2c7108.gif
 
Last edited by a moderator:
Pst, "player.color" doesn't actually exist normally, it's "player.skincolor" you want.


That said, I think I know what's going on here: -1 (or 255, since p.mo.color is UINT8) % MAXSKINCOLORS is 21, which happens to be Green. See, p.mo.color is limited to a number between 0 and MAXSKINCOLORS-1 in 2.1.14.
 
Last edited:
You'd be incorrect, then. Using out of range numbers should result in an error, not make a silently failing workaround attempt. Problems with scripts should be clearly communicated to the coder.
 
On the other hand, being able to set color "none" is not a bug. Not updating the console variable is not a bug. (If you want to overwrite user choices, add stuff to the console buffer, duh.)
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top