[Pogamut-list] players.getNearestVisiblePlayer() throws null

jakub.gemrot pogamut-forum at diana.ms.mff.cuni.cz
Sat Oct 29 11:47:48 CEST 2011


Re: players.getNearestVisiblePlayer() throws null

Author: jakub.gemrot

Which version of Pogamut are you running?

HunterBoj.java:291 is currently

    }


What is your code at line "291" in the HunterBot example?

Nevertheless your code is likely to throw NPE anyway because "players.getNearestVisiblePlayer()" evaluates to NULL in case you do not see any player. Thus calling "getName()" on it will result in NPE.

Best,
Jakub

-- 
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=849&post_reply=1#form>





More information about the Pogamut-list mailing list