diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-09-23 14:10:05 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-09-23 14:10:05 +0000 |
| commit | 815c55c4ce58995dcc34627bcbed956d1a1bc4dd (patch) | |
| tree | ae33fb8915f06865369208c5402122555b90d905 /src/game/server/hooks.cpp | |
| parent | 8f9e2031dcd562e72ac7e5ec9c00b8aed10b53a6 (diff) | |
| download | zcatch-815c55c4ce58995dcc34627bcbed956d1a1bc4dd.tar.gz zcatch-815c55c4ce58995dcc34627bcbed956d1a1bc4dd.zip | |
added death tile
Diffstat (limited to 'src/game/server/hooks.cpp')
| -rw-r--r-- | src/game/server/hooks.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/game/server/hooks.cpp b/src/game/server/hooks.cpp index 41058dd1..bd2b5f4f 100644 --- a/src/game/server/hooks.cpp +++ b/src/game/server/hooks.cpp @@ -352,9 +352,22 @@ void mods_init() { for(int x = 0; x < tmap->width; x++) { - int index = tiles[y*tmap->width+x].index - ENTITY_OFFSET; - vec2 pos(x*32.0f+16.0f, y*32.0f+16.0f); - game.controller->on_entity(index, pos); + int index = tiles[y*tmap->width+x].index; + + if(index >= ENTITY_OFFSET) + { + vec2 pos(x*32.0f+16.0f, y*32.0f+16.0f); + game.controller->on_entity(index-ENTITY_OFFSET, pos); + } + else + { + if(index == TILE_DEATH) + tiles[y*tmap->width+x].index = COLFLAG_DEATH; + else if(index == TILE_SOLID) + tiles[y*tmap->width+x].index = COLFLAG_SOLID; + else + tiles[y*tmap->width+x].index = 0; + } } } |