proc/powering()
while(active)
for(var/obj/electrionics/battery/b)
if(b.power<=0)
usr <<"Battery Depleted"
active=0
else
b.power-=100
power+=100
sleep(30)
ID:144571
Oct 25 2006, 11:26 am
|
|
I've tracked the problem down to this proc. The Infinite loop is strange.
|
Assuming that it's not like that in your code (I'm geussing that it didn't copy/paste correctly), there may not be any battery objs in the world. I suggest doing some safety check the loop like this:
proc/powering() |
In response to Popisfizzy
|
|
I made a little mistake i forgot to add something
proc/powering() |
In response to Yorae
|
|
mob/proc/powering() id try something more like that! it always unsets active even if there arent objects, and then turns it back on if the power is over 0, also i set src.contents and made it a mob/proc, im assuming u already had it as a mob proc... but just incase lol |
There are quite a few problems with this code, and I'm surprised that no one has pointed them out to you.
|
In response to Audeuro
|
|
Audeuro wrote:
There are quite a few problems with this code, and I'm surprised that no one has pointed them out to you. no one has pointed them out? i recoded it and fixed those things and pointed them out o.O |
In response to Falacy
|
|
Theres a problem with the code you posted it just doesn't generate the power anymore mine did but had the loop problem.
Edit: I've tried many diffrent ways but the problem is that is doesn't give power at all or it just gives me the infinite loop any other ideas? |
In response to Falacy
|
|
Nice recent edit. At the time of posting, your code still have 3/4 of those mistake and added in another one. The design in your "rewrite" of the code is still not really sufficient enough.
|
In response to Audeuro
|
|
I was talking about Falacys code its more or less the same as one of my attempts what am i doing wrong.
|
and you dont have anywhere for that for check to look
ie: for(stuff in world)