diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-24 01:40:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-24 01:51:34 +0300 |
commit | 8bc4bd6a1180df29d55636793f0293bf575ea550 (patch) | |
tree | e76da560653f718ccd017a4443dea0ca7df309bc | |
parent | c04b7289eb1dd2bcd51d5d024af3ab419f958e28 (diff) | |
download | plus-8bc4bd6a1180df29d55636793f0293bf575ea550.tar.gz plus-8bc4bd6a1180df29d55636793f0293bf575ea550.tar.bz2 plus-8bc4bd6a1180df29d55636793f0293bf575ea550.tar.xz plus-8bc4bd6a1180df29d55636793f0293bf575ea550.zip |
Add for groundtop collision support (special walkable collision).
This collision now interpreted like tile without collision.
-rw-r--r-- | src/resources/mapreader.cpp | 22 |
1 files 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 <iostream> #include <zlib.h> +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); + } + } } } |