diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-01-12 07:38:57 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-01-12 07:38:57 -0500 |
commit | d3792c499ce9e33f314e06d102d2a0119108e8d3 (patch) | |
tree | e613126367773a4077cb74c8e0994870df9db38a /src/world.cpp | |
parent | a2284d1c9be35744cb43a91148c82cff64be7a43 (diff) |
world linking xml'd
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/world.cpp b/src/world.cpp index e66fb0d..e2c6aa9 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -185,6 +185,8 @@ void World::load(std::ifstream *i){ } } +void *NULLPTR = NULL; + World::World(void){ bgm = NULL; @@ -195,9 +197,9 @@ World::World(void){ */ behind = - infront = + infront = NULL; toLeft = - toRight = NULL; + toRight = (World **)&NULLPTR; /* * Allocate and clear an array for star coordinates. @@ -1151,19 +1153,19 @@ NPC *World::getAvailableNPC(void){ } World *World::goWorldLeft(Player *p){ - if(toLeft&&p->loc.x<x_start+HLINE*15){ - p->loc.x=toLeft->x_start+getWidth(toLeft)-HLINE*10; - p->loc.y=toLeft->line[toLeft->lineCount-GEN_INC-1].y; - return toLeft; + if(toLeft[0]&&p->loc.x<x_start+HLINE*15){ + p->loc.x=toLeft[0]->x_start+getWidth(toLeft[0])-HLINE*10; + p->loc.y=toLeft[0]->line[toLeft[0]->lineCount-GEN_INC-1].y; + return toLeft[0]; } return this; } World *World::goWorldRight(Player *p){ - if(toRight&&p->loc.x+p->width>x_start+getWidth(this)-HLINE*10){ - p->loc.x=toRight->x_start+HLINE*10; - p->loc.y=toRight->line[0].y; - return toRight; + if(toRight[0]&&p->loc.x+p->width>x_start+getWidth(this)-HLINE*10){ + p->loc.x=toRight[0]->x_start+HLINE*10; + p->loc.y=toRight[0]->line[0].y; + return toRight[0]; } return this; } |