Page 1 of 1
minor bug in mapreader.cpp
Posted: 06 Jan 2010, 18:57
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.
Re: minor bug in mapreader.cpp
Posted: 06 Jan 2010, 20:27
by Kage
IIRC objType is converted to uppercase in the XML reading level
Re: minor bug in mapreader.cpp
Posted: 06 Jan 2010, 23:52
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
Re: minor bug in mapreader.cpp
Posted: 07 Jan 2010, 01:47
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.
Re: minor bug in mapreader.cpp
Posted: 07 Jan 2010, 08:34
by zefram
No bitching intended but:
> src/utils/stringutils.h:45
> Converts the given strong to upper case
Re: minor bug in mapreader.cpp
Posted: 07 Jan 2010, 09:02
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