cppcheck updates.
authorGwyn Ciesla <gwync@protonmail.com>
Tue, 12 Jul 2022 19:23:02 +0000 (14:23 -0500)
committerGwyn Ciesla <gwync@protonmail.com>
Tue, 12 Jul 2022 19:23:02 +0000 (14:23 -0500)
motion.cpp
radar_plot.cpp

index 7b78686..699578f 100644 (file)
@@ -16,7 +16,7 @@ game_object change_elevation(game_object object){
       adjust--;
     };
     
-    if((object.x>1&&adjust<0)||(object.x<17&&adjust>0)){
+    if((object.x>1)&&(object.x<17)){
       object.x = object.x+adjust;        
     };
   };
@@ -260,11 +260,7 @@ game_object process_direction(game_object object, int input){
   } else {
  
     if(input==4||input==6||input==1||input==7||input==3||input==9){
-      if(object.direction!=input){
-       object.speed = 0;
-      } else {
-       object.speed = 1;
-      };
+      object.speed = 0;
       object.direction = input;
       
     };
index 0596d68..b7c8913 100644 (file)
@@ -6,7 +6,7 @@
 void radar_plot(game_object object, int drawlocation){
 
   if(object.x>0&&object.y>0&&object.active==1){
-    int line = 0;  //vert plot pos
+    int line = 1;  //vert plot pos
     int row = 0;  //horiz plot pos
     int x_offset = 19; //offset for height
     int y_offset = 17; //offset for display
@@ -14,9 +14,7 @@ void radar_plot(game_object object, int drawlocation){
     int dl_radar; //main offset
 
     //set line based on height rules
-    if(object.x<=3){
-      line = 1;
-    } else if(object.x>=4&&object.x<=9){
+    if(object.x>=4&&object.x<=9){
       line = 2;
     } else if(object.x>=10&&object.x<=15){
       line = 3;
@@ -49,4 +47,4 @@ void radar_plot(game_object object, int drawlocation){
     //plot with symbol
     mvprintw(line,row,"%s",object.radar);
   };
-}
\ No newline at end of file
+}