shithub: cstory

Download patch

ref: 073a15b41b2f959341392f988287097fdf14cb78
parent: fa304081fe7bcab74990eda3eb510befa299a36b
author: Gabriel Ravier <gabravier@gmail.com>
date: Tue Nov 5 12:06:06 EST 2019

Documentation : Comment implicit truncation

--- a/src/NpcAct080.cpp
+++ b/src/NpcAct080.cpp
@@ -1081,6 +1081,8 @@
 		case 10:
 			if (++npc->act_wait > 100 && npc->act_wait % 6 == 1)
 			{
+				// The range of unsigned char is [0, 255] so these two values are implicitly truncated (Might be UB ?)
+				// TODO : Investigate on whether this is erroneous
 				if (npc->direct == 0)
 					deg = 0x88;
 				else
--- a/src/NpcAct260.cpp
+++ b/src/NpcAct260.cpp
@@ -1291,6 +1291,8 @@
 		case 51:
 			if (++npc->act_wait > 30 && npc->act_wait % 4 == 1)
 			{
+				// The range of unsigned char is [0, 255] so these two values are implicitly truncated (Might be UB ?)
+				// TODO : Investigate on whether this is erroneous
 				if (npc->direct == 0)
 					deg = 0x88;
 				else