ID:148516
 
Hi all i'm using Malver's war demo and i've taken out alot of the procs for a game i'm making.

I'm getting an invalid expression error at this line.

If(O) sleep(O.speed) // Wait before moving the projectile forwards again

Its all indented right and the funny thing is if I coment it out I get another invalid expression error for line 1 of another dm file. Its part of the loop so heres the full code for it.

mob/proc/Fire(var/mob/ch, var/dir)
var/obj/Weapon/O = new /obj/Weapon/SBall
O.dir = ch.dir
O.loc = ch.loc // These top 3 lines create the projectile and place it where the mob firing is
while(O)
step(O, dir) // Move the projectile forward
var/turf/Y = get_step(O, O.dir)
if(!Y) // If the projectile hits the end of the map...
del(O)
break
var/turf/X = O.loc
for(var/mob/M as mob in X) // If another mob is hit by the projectile...
if(M == ch) // Make sure the projectile didn't somehow hit the person who shot it
continue
Damage(M, O.damage)
del(O)
spawn(4)
if(O) sleep(O.speed) // Wait before moving the projectile forwards again

So anyone see the prob?

Well, you have an empty spawn() clause near the end there; that can't be helping matters. Given where your bug is occurring I bet that's it.

Lummox JR
In response to Lummox JR (#1)
Where do i put it? i tried putting it after the last for loop and i got the same error.
In response to Unowuero (#2)
Unowuero wrote:
Where do i put it? i tried putting it after the last for loop and i got the same error.

Put what? The spawn()? I have no idea what you're trying to spawn out, which is the real key.

Lummox JR
In response to Lummox JR (#3)
Allright thanks anyways... I'll take it to Malver on my walk home. Since its his code I hope he'll be able to help me.

Unowuero