Issue information

Issue ID
#4547
Status
Duplicate
Severity
None
Started
Hercules Elf Bot
Nov 12, 2010 13:35
Last Post
Hercules Elf Bot
Nov 12, 2010 13:35
Confirmation
N/A

Hercules Elf Bot - Nov 12, 2010 13:35

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

Hi,

i just recompiled after a long time the latest eA Trunk with Visual C++ Express 2010 and got some warning during it from the int_guild.c files in char and char_sql folder.

warning C4244: 'initializing': conversion from 'uint64' to 'unsigned int', possible loss of data
warning C4244: '=': conversion from 'uint64' to 'unsigned int', possible loss of data

So, i took a quick look into these 2 files, when you search for mapif_parse_GuildMemberInfoChange you see this right below:

// Could make some improvement in speed, because only change guild_member
int i;
struct guild * g;

just change the int i; into uint64 i; and little below we find this:

case GMI_EXP:
{ // EXP
unsigned int exp, old_exp=g->member[i].exp;

unsigned int exp, into uint64 exp, .

And again a little below:

// Update guild exp
if (exp > UINT_MAX - g->exp)
g->exp = UINT_MAX;
else
g->exp+=exp;

g->exp+=exp; into g->exp+=g->exp;

It's the same in both files that needs to be changed. I'm not sure if this is the best or right way, as i said i just took a quick look at it and i'm in school right now xD But the errors did disappear and the guild exp still got correctly updatet ingame, so i think it's okay.

Regards
Masao

This post has been edited by Masao: Nov 12 2010, 05:37 AM