From 8bc4bd6a1180df29d55636793f0293bf575ea550 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Jun 2012 01:40:57 +0300 Subject: Add for groundtop collision support (special walkable collision). This collision now interpreted like tile without collision. --- src/resources/mapreader.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 818968621..ae5821182 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -41,6 +41,8 @@ #include #include +extern int serverVersion; + int inflateMemory(unsigned char *in, unsigned int inLength, unsigned char *&out, unsigned int &outLength); @@ -407,8 +409,24 @@ inline static void setTile(Map *map, MapLayer *layer, int x, int y, int gid) { // Set collision tile // if (set && (gid - set->getFirstGid() == 1)) buggy update - if (set && (gid - set->getFirstGid() != 0)) - map->blockTile(x, y, Map::BLOCKTYPE_WALL); + if (set) + { + if (serverVersion > 0) + { + switch (gid - set->getFirstGid()) + { + case 4: // GROUNDTOP collision + break; + default: + map->blockTile(x, y, Map::BLOCKTYPE_WALL); + break; + } + } + else if (gid - set->getFirstGid() != 0) + { + map->blockTile(x, y, Map::BLOCKTYPE_WALL); + } + } } } -- cgit v1.2.3-70-g09d2