Fixed gate/other object wrap. I think.
authorlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Wed, 15 Nov 2006 14:16:01 +0000 (14:16 +0000)
committerlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Wed, 15 Nov 2006 14:16:01 +0000 (14:16 +0000)
git-svn-id: svn+ssh://svn/var/repos/curfender@518 bc5cbbab-a4ec-0310-bb52-ff3d296db539

main.cpp

index e8b28df..513710f 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -47,13 +47,15 @@ game_object process_motion(game_object object){
   };
 
   //wrap check
-  if(object.y<=0){
-    object.y=object.y+560;
-    drawlocation=drawlocation+560;
-  };
-  if(object.y>=560){
-    object.y=object.y-560;
-    drawlocation=drawlocation-560;
+  if(object.number==1){
+    if(object.y<=0){
+      object.y=object.y+560;
+      drawlocation=drawlocation+560;
+    };
+    if(object.y>=560){
+      object.y=object.y-560;
+      drawlocation=drawlocation-560;
+    };
   };
 
   return object;
@@ -89,21 +91,27 @@ int draw_object(game_object object, int drawlocation){
     };
   };
   
-  if((object.y-drawlocation>0)and(object.y-drawlocation<79)){
-    if(object.active==1){
-      if(object.face==0){
-       mvprintw(object.x,object.y-drawlocation,"%s",object.line0);
-      };
-      if(object.face==1){
-       mvprintw(object.x,object.y-drawlocation,"%s",object.line1);
-      };
-      if(object.face==2){
-       mvprintw(object.x,object.y-drawlocation,"%s",object.line1);
-       mvprintw(object.x-1,object.y-drawlocation,"%s",object.line0);
-      };
-    };
+  int offset;
+  
+  if((drawlocation>=480)and(object.number!=1)){
+    offset = drawlocation-560;
+  } else {
+    offset = drawlocation;
   };
 
+  if(object.active==1){
+    if(object.face==0){
+      mvprintw(object.x,object.y-offset,"%s",object.line0);
+    };
+    if(object.face==1){
+      mvprintw(object.x,object.y-offset,"%s",object.line1);
+    };
+    if(object.face==2){
+      mvprintw(object.x,object.y-offset,"%s",object.line1);
+      mvprintw(object.x-1,object.y-offset,"%s",object.line0);
+    };
+  };
+  
   return drawlocation;
 
 }