From: Gwyn Ciesla Date: Tue, 12 Jul 2022 19:23:02 +0000 (-0500) Subject: cppcheck updates. X-Git-Tag: 1.14~3 X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=4a3fc9506dd85ceaf4e8e9de4dda6b734584dcdf;p=curblaster.git cppcheck updates. --- diff --git a/motion.cpp b/motion.cpp index 7b78686..699578f 100644 --- a/motion.cpp +++ b/motion.cpp @@ -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; }; diff --git a/radar_plot.cpp b/radar_plot.cpp index 0596d68..b7c8913 100644 --- a/radar_plot.cpp +++ b/radar_plot.cpp @@ -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 +}