ID:161861
 
ok, i've just found a glitch where you can walk away from a fight and still attack the target over a distance. I tried this:
if(!src in oview(1))return
but this didn't work. I must have been away from coding too long as i've forgotten the basics! thanks in advance.
Im not so good with ! and whatnot but i would use
if(src in oview(1))
In response to Lt. Pain
! makes a conditional negative. So, no offense, but i don't think you know what you're talking about here.
In response to Adam753
XD believe me i i do, i code alot use what i sent it will work.

(yes i know not using ! seems newbie but what u gonna do =/)
! has a higher operational standing than 'in', so what the program thinks you are asking is the following:
if(!src in X)
if((!src) in X)
if(0 in X)


Solution: Bracket the object and the list you are looking in:
if(!(src in X))
In response to Lt. Pain
wow, i didn't think that was going to work! i don't see the difference. what was the problem?
In response to GhostAnime
ooooohh, that makes sense. I don't know anything about operational standing. once I coded something which caused a bug that glitched up half of my game, and it all turned out to be because i didn't know that && has a higher operational standing than ||.
In response to Adam753
The !, i know what it does but idk what it would do in
 if(!src in oview(1))

but
if(src in oview(1))
uses the if proc, so that if the statement in the () is true it reads the commands indented under it otherwise it skips and continues down
    if(us in oview(1))
usr<<"Test"
return

See if the usr is within one tile it will continue down and execute the command under it, but if the usr is not within one tile it will simply skip down to the return command.
In response to Adam753
Even I don't remember how the operational standing is (didn't bother to remember, just remembering that ! > 'in'), so I usually bracket in my operations if different types of operations are being done in one line.

If you are interested in the order of operations, check out the operators entry in the DM Reference