Monument ShadowMUD

Fighter

[07-27 20:57][Fighter]Icewolfz: i use / in several places
[07-27 20:57][Fighter]Icewolfz: / is safe as long as it is not /0
[07-27 20:57][Fighter]Aim: fixed 1/100 math is fine
[07-27 20:57][Fighter]Icewolfz: and the /0 is easy to work around a simple if(!number) cant do that
[07-27 20:57][Fighter]Aim: its when the divisor is a variable. that can always lead to ruin
[07-27 20:57][Fighter]Icewolfz: it jus ta simple test
[07-27 20:58][Fighter]Icewolfz: if(var == 0) var = 1
[07-27 20:58][Fighter]Icewolfz: easy fix there
[07-27 20:58][Fighter]Aim: or even lazier and less cpu .. (var/var2) = var3+1
[07-27 20:58][Fighter]Icewolfz: not worryed about /0 stuff just a matterof simple error checking
[07-27 20:58][Fighter]Icewolfz: that would break
[07-27 20:59][Fighter]Icewolfz: easier way at least in lpc is var = var || 1
[07-27 20:59][Fighter]Icewolfz: +1 is not a god check
[07-27 20:59][Fighter]Icewolfz: what if it is -1 ;)
[07-27 20:59][Fighter]Aim: oh yeah var/var2+1 = var3
[07-27 20:59][Fighter]Icewolfz: as -1 + 1 = 0
[07-27 20:59][Fighter]Aim: thats the stupid lazy slightly wrong way, but its cheap in cpu
[07-27 20:59][Fighter]Icewolfz: better ot do var / (var2 || 1)
[07-27 20:59][Fighter]Icewolfz: || is the lazy way in lpc
[07-27 21:00][Fighter]Icewolfz: lpc is like javascript nad does a truthy system
Back to List

ShadowMUD
10:59, Flameday, Kepki 13, 170 AD.

Vote for Our Mud on TMC! Desert Bus for Hope