Fixed NPC wrap vanish issue. Finally.
authorlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Fri, 1 Dec 2006 16:43:51 +0000 (16:43 +0000)
committerlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Fri, 1 Dec 2006 16:43:51 +0000 (16:43 +0000)
git-svn-id: svn+ssh://svn/var/repos/curfender@546 bc5cbbab-a4ec-0310-bb52-ff3d296db539

main.cpp

index 5e2c0e5..092627c 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -172,13 +172,17 @@ int draw_object(game_object object, int drawlocation){
     };
     
     int offset = 0;
-    
-    if((drawlocation>=540)&&(object.number!=1)&&(object.y>=540)){
-      offset = object.y-drawlocation;
-    } else {
-      offset = object.y-drawlocation;
+
+    offset = object.y-drawlocation;
+
+    if(drawlocation>=540&&object.y<620-drawlocation&&object.number!=1){
+      offset = 620-drawlocation+object.y;  //right of player wrap correction
     };
-    
+
+    if(drawlocation<0&&object.y>=540&&object.number!=1){
+      offset = abs(drawlocation)-(620-object.y);  //left of player wrap correction
+    };
+
     if(object.active==1){
       if(object.face==0){
        mvprintw(object.x,offset,"%s",object.line0);
@@ -493,6 +497,7 @@ game_object pod9;
 
     // Draw pods objects 2-9
     drawlocation = draw_object(pod2, drawlocation);
+    /*
     drawlocation = draw_object(pod3, drawlocation);
     drawlocation = draw_object(pod4, drawlocation);
     drawlocation = draw_object(pod5, drawlocation);
@@ -500,6 +505,7 @@ game_object pod9;
     drawlocation = draw_object(pod7, drawlocation);
     drawlocation = draw_object(pod8, drawlocation);
     drawlocation = draw_object(pod9, drawlocation);
+    */
     
     // Draw gate object 10
     drawlocation = draw_object(gate, drawlocation);
@@ -516,6 +522,7 @@ game_object pod9;
     radar_plot(gatebeam2, drawlocation);
     radar_plot(gatebeam3, drawlocation);
     radar_plot(pod2, drawlocation);
+    /*
     radar_plot(pod3, drawlocation);
     radar_plot(pod4, drawlocation);
     radar_plot(pod5, drawlocation);
@@ -523,10 +530,11 @@ game_object pod9;
     radar_plot(pod7, drawlocation);
     radar_plot(pod8, drawlocation);
     radar_plot(pod9, drawlocation);
+    */
     radar_plot(player, drawlocation);
 
     //debug
-    mvprintw(21,1,"y:%d drawloc:%d", player.y, drawlocation);
+    mvprintw(21,1,"y:%d drawloc:%d", pod2.y, drawlocation);
 
     //get the cursor out of the way
     mvprintw(23,79,"|");