minor bug in mapreader.cpp

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
zefram
Peon
Peon
Posts: 8
Joined: Tue Dec 08, 2009 10:13 am

minor bug in mapreader.cpp

Post by zefram » Wed Jan 06, 2010 7:57 pm

In the mapreader.cpp there is this code:

if (objType == "WARP" || objType == "NPC" ||
objType == "SCRIPT" || objType == "SPAWN")
{
// Silently skip server-side objects.
continue;
}

But many maps has "warp" or "Warp" in it so it sometimes work but sometimes don't. I'm not sure what that code is for, but I think it doesn't work as it was intended. Some uppercase on objType maybe?

Maybe it was fixed meanwhile, i use 0.0.29.1, so ignore it.
User avatar
Kage
Warrior
Warrior
Posts: 927
Joined: Sat May 02, 2009 7:12 pm

Re: minor bug in mapreader.cpp

Post by Kage » Wed Jan 06, 2010 9:27 pm

IIRC objType is converted to uppercase in the XML reading level
<Kage_Jittai> ... are you saying I am elite :D
<thorbjorn> Yes. :P
zefram
Peon
Peon
Posts: 8
Joined: Tue Dec 08, 2009 10:13 am

Re: minor bug in mapreader.cpp

Post by zefram » Thu Jan 07, 2010 12:52 am

It is not in 0.0.29.1, because I found this bug exactly because it was not lower/upper cased, was it fixed later?

Add this:

std::cout << "objType = " << objType << std::endl;

Enter desert under tulishmar, you will see this:

Load map maps/002-1.tmx
objType = WARP
objType = SPAWN
objType = NPC
objType = NPC
objType = NPC
objType = NPC
objType = NPC
objType = SCRIPT
objType = WARP
objType = WARP
objType = WARP
objType = warp <------ here, you see? Im not lying!
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
objType = spawn
User avatar
Kage
Warrior
Warrior
Posts: 927
Joined: Sat May 02, 2009 7:12 pm

Re: minor bug in mapreader.cpp

Post by Kage » Thu Jan 07, 2010 2:47 am

I fixed it with this patch: http://gitorious.org/mana/mana/commit/4 ... 016b544633

You should be able to adapt that patch to be able to apply to 0.0.29.1 if you want to decrease warnings or something.
<Kage_Jittai> ... are you saying I am elite :D
<thorbjorn> Yes. :P
zefram
Peon
Peon
Posts: 8
Joined: Tue Dec 08, 2009 10:13 am

Re: minor bug in mapreader.cpp

Post by zefram » Thu Jan 07, 2010 9:34 am

No bitching intended but:

> src/utils/stringutils.h:45
> Converts the given strong to upper case
User avatar
Freeyorp101
Administrator
Administrator
Posts: 704
Joined: Tue Nov 04, 2008 10:17 am
Location: New Zealand

Re: minor bug in mapreader.cpp

Post by Freeyorp101 » Thu Jan 07, 2010 10:02 am

zefram wrote:No bitching intended but:

> src/utils/stringutils.h:45
> Converts the given strong to upper case
[Fixed.]

Thanks for reporting :)


---Freeyorp
(09:58:17) < tux9th> Freeyorp: your sig on the forums is kind of outdated
Post Reply