Log in

View Full Version : /who all frog


Knightly
02-17-2008, 11:51 AM
I've been trying to track down why when you do a /who all, frogloks show up as piranhas.

I know that it is because /who all returns 74 instead of 330 for the race of the froglok but I'm not sure where to fix this. Can someone point me in the right direction?

Here's what I've found so far:
In clientlist.cpp, the following returns the number of the race:
plrace=cle->race();

This is defined in cliententry.h which has
inline int16 race() const { return prace; }

cliententry.h takes me to cliententry.cpp which has
prace = scl->race;

clienentry.cpp takes me to servertalk.h and that's where I get stuck:
struct ServerClientList_Struct {
int8 race;

But now I'm having trouble finding where this gets set.

I know that I can change clientlist.cpp from:
plrace=cle->race();

To:
plrace=((cle->race() == FROGLOK2) ? FROGLOK : cle->race());

And this will make them show up correctly, but it seems like this would be fixing it in the wrong place. It also doesn't make it so that I can do "/who all frog" since it is only fixing the display. I still have to do "/who all piran" to get the frogloks on the server.

I'm hoping that someone more familiar with this aspect of the code can save me some search time. Anyone know what I should be looking at?

So_1337
02-17-2008, 01:58 PM
I know nothing at all, but I find it interesting that what it is looking for and what it is finding are apart from one another by a value of 256. This reminds me of the issue that KLS reported when trying to script door IDs into the player.pl files; the door value would sometimes inexplicably be off by 128.

If nothing else, at least now we see it's occurring in more than one location. That give any idea of where to track it down?

Theeper
02-17-2008, 05:36 PM
The variable race needs be int16 in ServerClientList_Struct to hold a value of 330.

Knightly
02-17-2008, 07:10 PM
Thanks Theeper. That took care of the first problem (they now show up as frogloks) but I still can't do /who all frog. As a good side effect though, /who all piranha also no longer works ;-)