minor bug in mapreader.cpp

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
zefram
Peon
Peon
Posts: 8
Joined: 08 Dec 2009, 09:13

minor bug in mapreader.cpp

Post by zefram »

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
Manasource
Manasource
Posts: 929
Joined: 02 May 2009, 18:12

Re: minor bug in mapreader.cpp

Post by Kage »

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, 09:13

Re: minor bug in mapreader.cpp

Post by zefram »

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
Manasource
Manasource
Posts: 929
Joined: 02 May 2009, 18:12

Re: minor bug in mapreader.cpp

Post by Kage »

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, 09:13

Re: minor bug in mapreader.cpp

Post by zefram »

No bitching intended but:

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

Re: minor bug in mapreader.cpp

Post by Freeyorp101 »

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