MegaZeux TRWTF codes
-
I found this TRWTF code in MegaZeux:
[code] int web_flags = (move_flags & (MUST_WEB | MUST_THICKWEB)) >> 5; int web = (d_id == WEB) || (d_id == THICK_WEB); if((web < 1) || (web > 2)) web = 0;
if(web_flags) { // Must be one of these if(!(web_flags & web)) return HIT; }[/code]</pre></p>
You should be able to see how not sense that is. The web less than 1 or greater than 2 condition makes no sense here. I fixed it to what it was obviously supposed to be:
[code] int web_flags = (move_flags & (MUST_WEB | MUST_THICKWEB)) >> 5; int web = (d_id == WEB)+(d_id == THICK_WEB)*2; if(web_flags) { // Must be one of these if(!(web_flags & web)) return HIT; }[/code]
I tested it and now it works OK.
I also found a lot of other TRWTF codes in MegaZeux, which I also fixed. In the overlay-handling code there was something like if(overlay_mode==4) {do something} else {do the exact same thing but this time don't ignore the character from the overlay}. Also, overlay_mode could never be 4 anyways, because the only values MegaZeux uses are 0,1,2,3 and it will never even reach that condition if it is 4 because it is inside of another condition, that checks for (overlay_mode&3) among other things.
-
TRWTF is that people still use MegaZeux
-
Seriously, ZZT is all anyone but the most rabid game designer needs.