The problem: If I leave the first FOR LOOP where it's at, it does nothing at all, no message, no lifting, nothing. If I put the first FOR LOOP as the second loop, it gives me the message, but that's no good either because that means it failed, and it always fails the same way -- check 1 = 0, check 2 = 1, check 3 = 0. And finally, if I use the first FOR LOOP as the last check, it will lift any block up no matter it's position.
mob
proc
Pickup()
var/turf
T = get_step(src,NORTH)
Tu = get_step(src,src.dir)
A = get_step(Tu,NORTH)
var/obj/block/B
var
chk=0; chk2=0; chk3=0
if(T.density) return
if(A.density) return
for(var/obj/block/C in Tu) //Is there a block in front of him. FOR loop 1
if(C)
chk=1; B=C; break
for(B in T) //Is the tile above blocked?
if(!B)
chk2=1; break
for(var/obj/block/D in A) //Is there a block above the block in front of him?
if(!D)
chk3=1; break
if(!B) return
if(chk && chk2 && chk3 == 0)
BUG("Error. Check 1: [chk]; Check 2: [chk2]; Check 3: [chk3]"); return
else
src.ac = 1
B.Pickup(T,src)
You have a proc that is allowing players to drop 2x2 blocks. The block can be placed in two patterns, depending on the direction you are facing:
What you want is a system for figuring out whether or not you can place the 4 block obj's in those locations.
Right?