endbattle(list/playerL,list/enemyL,list/MOBL)
sleep(10)
var/battleoutcome = ""
var/enemyEXP
var/mob/player/partyleader
for(var/mob/M in MOBL)
if(istype(M,/mob/player) && M.ispartyleader == 1)
partyleader = M
break
partyleader.PartyInfo("<b>==============BATTLE FINISH==============</b>\n")
Problem description:
runtime error: Cannot execute null.PartyInfo().
proc name: endbattle (/proc/endbattle)
source file: BATTLESYSTEM V2.dm,472
usr: Sand (/mob/player)
src: null
call stack:
endbattle(/list (/list), /list (/list), null)
endbattlecheck(/list (/list), /list (/list))
battlee(/list (/list), /list (/list))
Sand (/mob/player): startbattlee()
the battlearea (3,4,1) (/turf/battlearea): Entered(Sand (/mob/player), the grass (3,3,1) (/turf/grass))
I don't get how it is giving me null. The code goes through the moblist that consists of both players and enemies and returns the leader.
runtime error: Cannot execute null.PartyInfo().
proc name: endbattle (/proc/endbattle)
source file: BATTLESYSTEM V2.dm,472
usr: Sand (/mob/player)
src: null
call stack:
endbattle(/list (/list), /list (/list), null)
endbattlecheck(/list (/list), /list (/list))
You can see that endbattle() is being called with only two arguments in endbattlecheck() (the third argument is thus automaticaly null). In other words, you've not passing list/MOBL as an argument, so of course partyleader can't be found in it.