I know the attack verb doesn't work from my other post, but i get a runtime error when i attack the potions, which i don't want to effect. Heres the attacking verb...
obj
battling
icon= 'SpellIcons.dmi'
Axe
icon_state = "Soldier1"
New(Loc)
for(var/mob/M in Loc)
M.HP-= rand(10)
M.overlays += 'OwOverlay.dmi'
sleep(2)
M.overlays -= 'OwOverlay.dmi'
M.DeathCheck()
Heres the Runtime Error...
runtime error: Cannot read 0.HP
proc name: Entered (/turf/items/HP_Potion/Entered)
usr: 0
src: HP Potion (19,27,1) (/turf/items/HP_Potion)
call stack:
HP Potion (19,27,1) (/turf/items/HP_Potion): Entered(Axe (/obj/battling/Axe), Unknown Person (/mob))
Heres the verb...
mob
Soldier
verb
Action1()
if(src.Ammo <= 5)
src << "Not enough ammo to throw the Axe..."
else
view() << sound('AttackSword.wav')
src.Ammo -= 5
var/A = new /obj/battling/Axe (src)
walk(A,dir,0.1)
sleep(30)
walk(A,0)
del(A)
Can anybody tell me how to fix this problem?
ID:261691
Jan 1 2003, 2:03 pm
|
|
The verb you showed is not turf/items/HP_Potion/Entered(), which is where your crash is happening. And it's obvious from the message that since usr is 0 and you're trying to read 0.HP, that you've got usr.HP in there and are therefore trying to use usr in Entered()--where it doesn't belong.
I very much wonder why you implemented potions as turfs instead of objs; there's no sensible reason I can think of to do that. Instead, you should simply override turf/Entered() to pick up such things automatically:
Lummox JR