Issue information

Issue ID
#244
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Oct 18, 2007 9:30
Last Post
Hercules Elf Bot
Apr 19, 2012 18:20
Confirmation
N/A

Hercules Elf Bot - Oct 18, 2007 9:30

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=244

I found some code in script.c that manually enumerates the block_list internals instead of doing a map_foreach(), in function *getmapmobs.
Further investigation reveals that a very similar command already exists.

QUOTE
*getmapmobs("<map name>")
This function will return the total count of monsters currently located on the specified map.
If the map name is given as "this", the map the invoking character is on will be used.
If the map is not found, or the invoker is not a character while the map is "this", it will return -1.

QUOTE
*mobcount("<map name>","<event label>")
This function will count all the monsters on the specified map that have a given event label and return the number or 0 if it can't find any.
However, apparently, if you pass this function an empty string for the event label, it should return the total count of normal permanently respawning monsters instead.
I doubt that the 'event label ==""' trick will work due to a strcmp() being used, but imo these two could be merged.

mobcount is there since r1.
getmapmobs was added in r1182 as a part of a jAthena update.

Hercules Elf Bot - Jan 31, 2012 15:15

Originally posted by [b]Gepard[/b]
Fixed in [rev=15530].