for(var/turf/damageable/T as turf in X)
T.hp -= round(O.damage)
if(T.hp < 1)
del(T)
del(O)
break
else
Del(O)
break
There isn't any problem in compiling or during runtime for that matter. It's just that after the bullet which is being shot hits the turf, nothing happens except the bullet is deleted. Note that I do have X defined somewhere above that in the full coding.
I'll show these vars I have defined so there is not any confusion in that area.
obj/damageable
var
hp
maxhp
armor
Thanks,
Resonating Light
First off, that "as turf" isn't neccessary. It probably isn't affecting this in any way, but it's best to check. Also make doubly sure that X is a list that contains that turf. (It might help you show how you define and set up X.)
If the problem isn't on the above line, it would be here. Make sure that O.damage is at least 1. You might want to insert temporary debug messages to see exactly what's going on:
<code>for(var/turf/damageable/T as turf in X) world << "Before damage; [T] HP is [T.hp]" T.hp -= round(O.damage) world << "After damage; [T] HP is [T.hp]" if(T.hp < 1) del(T) del(O) break else Del(O) break</code>