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: 08 Dec 2009, 10:13

minor bug in mapreader.cpp

Post by zefram » 06 Jan 2010, 19:57

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: 02 May 2009, 19:12

Re: minor bug in mapreader.cpp

Post by Kage » 06 Jan 2010, 21:27

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: 08 Dec 2009, 10:13

Re: minor bug in mapreader.cpp

Post by zefram » 07 Jan 2010, 00:52

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: 02 May 2009, 19:12

Re: minor bug in mapreader.cpp

Post by Kage » 07 Jan 2010, 02:47

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: 08 Dec 2009, 10:13

Re: minor bug in mapreader.cpp

Post by zefram » 07 Jan 2010, 09:34

No bitching intended but:

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

Re: minor bug in mapreader.cpp

Post by Freeyorp101 » 07 Jan 2010, 10:02

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