ID:180880
 
"mob/proc/Attack(Target as mob|obj|null in view())" returns this warning message.

Removing "in view()" gets rid of the warning. Putting "in view()" between "Target" and "as mob|obj|null" does not work at all.

The code works with the warning, but figured I better figure out why I get it.

Note: This code is an oversimplified version of what actually exists. I've tested it with this code and duplicated the warning message.
"mob/proc/Attack(Target as mob|obj|null in view())" returns this warning message.

Here's an example Tom posted a while back:

The fix is to reverse the order so it reads:

as null|obj in src.wares

which means:

as null or (obj in src.wares)


So in your case, you probably want

mob/proc/Attack(Target as null | (mob|obj in view()))
In response to Guy T. (#1)
On 1/12/01 9:09 pm Guy T. wrote:
"mob/proc/Attack(Target as mob|obj|null in view())" returns this warning message.

Here's an example Tom posted a while back:

The fix is to reverse the order so it reads:

as null|obj in src.wares

which means:

as null or (obj in src.wares)


So in your case, you probably want

mob/proc/Attack(Target as null | (mob|obj in view()))

Heh, and to think that this warning was supposed to be for "clarification" purposes. I'm all for doing away with it altogether, so let's see if Dan concurs.
instead of "mob|obj|null" it should have been "null|mob|obj".

Thanks Guy T.

Tom,
I don't know if you really want to change it again or not, it's fairly simple once I realized it. I won't be making that mistake again. If null should be listed first for a reason, I wouldn't change it.

- -