ID:140522
 
Code:
client/Click(mob/M)
..()
if(M.icon =='Aaa.dmi')
if(M.icon_state=="a")
usr.Punchp(usr)
else
if(M.icon == 'Flower.dmi')
if(mob/M in usr:contents)
if(usr.Flower == 1)
usr.overlays -= M.icon
usr.Flower = 0
usr << "You take off 'Flower'"
else
usr.overlays += M.icon
usr.Flower = 1
usr << "You put on 'Flower'"
else
if(M.accesory==1)
if(mob/M in usr:contents)
if(usr.Wearing == 1)
usr.overlays -= M.icon
usr.Wearing = 0
usr << "You take off '[M.name]'"
else
usr.overlays += M.icon
usr.Wearing = 1
usr << "You put on '[M.name]'"
else
if(istype(M, /mob/spells/Instant_Teleportation))
if(usr:target:z==usr.z)
usr.blahicon = usr.icon
usr.icon = 'tele.dmi'
sleep(3)
usr.x = usr:target:x
if(usr:target:y == 1)
usr.y = usr:target:y
else
usr.y = usr:target:y-1
usr.z = usr:target:z
sleep(3)
usr.icon = usr.blahicon
usr << "You instantly appear before [usr:target]"
usr:target << "[usr] instantly appears before you!"
else
if(M.mon != null)
if(usr.z != M.z)
if(M.themesong != null)
usr << sound(null)
usr << sound(M.themesong,repeat=1)
else
if(M.icon=='monster.dmi'||M.name=="Punching Bag") //This is line 55 mentioned in the error btw
if(mob/M in oview(1))
if(usr.canthit!=1&&M.Splatting!=1)
usr.Battle(M)
M.Die()
usr.canthit = 1
sleep(10 - usr.ATKSPD)
usr.canthit = 0
usr.target = M
else
usr.target = M
usr << "<B><font color=#33CCFF>Your target is now [M]."


Problem description: This worked before, but I tried out my game today after getting the 455 BYOND update, and now when I try punching a pbag or monster in my game (I tried clicking spells in my game and that worked fine btw) I get this error in the game:

runtime error: Undefined operation: TrainerAbu (/mob) / Punching Bag (/mob/NPCs/Pbag1)
proc name: Click (/client/Click)
source file: battle.dm,55
usr: TrainerAbu (/mob)
src: MartialArtistAbu (/client)
call stack:
MartialArtistAbu (/client): Click(Punching Bag (/mob/NPCs/Pbag1), the turf (6,6,11) (/turf), "default.map1", "icon-x=14;icon-y=21;left=1;scr...")

I have "world/map_format = TILED_ICON_MAP" in my game, and I also added "mouse_opacity = 2" to the pbag already but I still get it :X
Well, you could probably increase your chances of someone taking this seriously if you used . and typecasting over :.
Once you've already defined the variable M, mob/M is evaluated as "mob divided by M".
In response to Garthor
That doesn't seem to be happening though, clicking some of the stuff in that code works for me, it's just the 55th line the error mentions which I left a comment where that line is and yyyyyeaaaaaaaaaa
In response to MartialArtistAbu
mob/M in the argument is valid, as that is where you are defining the variable M. After that, having mob/M elsewhere in the proc is not.
In response to Garthor
oooook thank you I kept thinking I was right but in the end you were right .... I think I accidentally changed M to mob/M when I was using find/replace before for something else .. anyways kkers problem solved :3.
In response to MartialArtistAbu
MartialArtistAbu wrote:
oooook thank you I kept thinking I was right but in the end you were right ....

Don't argue with Garthor. You will always lose.
In response to AJX
Mmm, yes...


There are several "programming guruu's"


Off the top of my head:

Lummox Jr
Garthor
Kaioken
Jeff(whatever the numbers are)
and some others whose names escape me, although the ones I listed above seem to be quite frequant for me. :)
In response to Speedro
Speedro wrote:
Mmm, yes...


There are several "programming guruu's"


Off the top of my head:

Lummox Jr <-- BYOND Developer. 99.99% Chance of being correct
Garthor <-- Very intelligent, though he has been known to be wrong from time to long other time.
Kaioken <-- Also very intelligent, and again is CAPABLE of being wrong.
Jeff(whatever the numbers are)<-- Same as the above two, though I'd rate them a bit higher.

You left out a lot of people, like Pop (though he is a dick, he has a thing about being right.), Nadrew, Tiberath, and a plethora of others.

In response to Speedro
There's other people who are helpful from time-to-time aswell, but you hit it basically right on the ball there, 'cept for not listing Kuraudo and Popisfizzy, and Schnitzelnagler to a point (I've seen him help several people before, so that kinda qualifies IMO).