ID:263618
 
Code:
obj
Fire
icon = 'fire.dmi'
icon_state = "fire1"
New()

spawn while(2)

sleep(7)
var/obj/Fire/F
var/random = rand(1,8)
if(random==1)
F = new(src.loc)
step_rand(F)


while(F)

var/obj/O=F.loc
if(O.density)
del(F)


Problem description:
What I want is for the fire not to be able to go through the dense objects such as a wall, but it does and it produces a Inf Loop also.

Setting network delay to 0.
Infinite loop suspected--switching proc to background.
If it is not an infinite loop, either do 'set background=1'> or set world.loop_checks=0.
proc name: New (/obj/Fire/New)
usr: Calus CoRPS (/mob)
src: (/obj/Fire)
call stack:
(/obj/Fire): New( (5,5,2) (/turf))

Set it's density to 1 for it to not go through walls. Don't know about the loop though.
In response to Yodamaster
Yodamaster wrote:
Set it's density to 1 for it to not go through walls. Don't know about the loop though.

Well the problem with that is the fire is not suppose to be densed.
In response to Calus CoRPS
it has to be, if not it will go thru walls. why cant it be dense?
In response to D347H_BY_C0MPU73R
It does not have to be dense, like I had said before I wanted it to check if it's location is on a dense location, if so delete the flame.
Maybe one of the following hypothesis is close to the answer:

- During the while(F), the object is not moving at all if there's no dense object thus it is stuck there indefinately and making it an infinite loop

- Maybe when you create a new instant of the same object, the DM notices the loop in the New() thus the suspecting of infinite loops


Just random guesses >_>
In response to Calus CoRPS
Use a Bump proc.
In response to Yodamaster
I no longer need help, I tried countless different way to get this to work and it did not so I decided since I was going to add oxygen into the game anyways I did this:
<code> New() spawn while(2) sleep(7) var/obj/Fire/F var/random = rand(1,8) if(random==1) F = new(src.loc) step_rand(F) var/turf/T=F.loc var/obj/O=F.loc //var/obj/Fire/F if(O.oxygen==0||T.oxygen==0) usr<<"g" del(F) </code>
This works, thanks to everyone who tried helping.