From 5b18283e5f8dffd4cae6b5b7ef09d67237383db5 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Tue, 5 Nov 2019 11:19:20 +0100 Subject: [PATCH] Documentation : Made some comments clearer Signed-off-by: Gabriel Ravier --- src/Generic.cpp | 2 +- src/MyChar.cpp | 2 +- src/MycParam.cpp | 2 +- src/NpcAct160.cpp | 2 +- src/NpcAct320.cpp | 8 ++++---- src/Sound.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Generic.cpp b/src/Generic.cpp index 8ea36f46..7c540e36 100644 --- a/src/Generic.cpp +++ b/src/Generic.cpp @@ -27,7 +27,7 @@ void GetCompileDate(int *year, int *month, int *day) months[10] = "Oct"; months[11] = "Nov"; months[12] = "Dec"; - sscanf(__DATE__, "%s %d %d", month_string, day, year); // The expansion of __DATE__ is not reproductible. We might want to change this + sscanf(__DATE__, "%s %d %d", month_string, day, year); // The expansion of __DATE__ is not reproductible. TODO : Think about changing this to be reproductible for (i = 0; i < 12; ++i) // This being 12 instead of 13 might be a bug, but it works anyway by accident if (!memcmp(&month_string, months[i], 3)) diff --git a/src/MyChar.cpp b/src/MyChar.cpp index c4551183..58e4c114 100644 --- a/src/MyChar.cpp +++ b/src/MyChar.cpp @@ -680,7 +680,7 @@ void ActMyChar_Normal(BOOL bKey) // Change position if (gMC.xm <= resist && gMC.xm >= -resist) { - // Okay, this is getting stupid. Why the HELL is the code written like this? + // This case is completely empty. This is most likely the result of commented code or some other change (so this is most likely inaccurate to the original source) } else { diff --git a/src/MycParam.cpp b/src/MycParam.cpp index 13b882c5..0da79938 100644 --- a/src/MycParam.cpp +++ b/src/MycParam.cpp @@ -135,7 +135,7 @@ void DamageMyChar(int damage) // Lose a whimsical star if (gMC.equip & 0x80 && gMC.star > 0) - gMC.star = (short)gMC.star - 1; // Why the hell is it written this way? + gMC.star = (short)gMC.star - 1; // For some reason, does a cast to short. Probably not accurate to the original source // Lose experience if (gMC.equip & 4) diff --git a/src/NpcAct160.cpp b/src/NpcAct160.cpp index 4efd9156..d1a45646 100644 --- a/src/NpcAct160.cpp +++ b/src/NpcAct160.cpp @@ -70,7 +70,7 @@ void ActNpc160(NPCHAR *npc) case 3: npc->damage = 20; - npc->damage = 0; // Smart code + npc->damage = 0; // Duplicate line if (++npc->act_wait > 24) { diff --git a/src/NpcAct320.cpp b/src/NpcAct320.cpp index 265c065b..1050a198 100644 --- a/src/NpcAct320.cpp +++ b/src/NpcAct320.cpp @@ -142,20 +142,20 @@ void ActNpc321(NPCHAR *npc) break; case 1: - if (gMC.direct == 0) + if (gMC.direct == 0) // Does the same thing whether this is false or true npc->x = npc->pNpc->x; else - npc->x = npc->pNpc->x; // Duplicate derp + npc->x = npc->pNpc->x; direct = 1; npc->y = npc->pNpc->y - 0x1400; break; case 2: - if (gMC.direct == 0) + if (gMC.direct == 0) // Does the same thing whether this is false or true npc->x = npc->pNpc->x; else - npc->x = npc->pNpc->x; // Duplicate derp + npc->x = npc->pNpc->x; direct = 3; npc->y = npc->pNpc->y + 0x1400; diff --git a/src/Sound.cpp b/src/Sound.cpp index 1e35fb1b..2c3b5336 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -390,7 +390,7 @@ int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no) ++ptp_pointer; } - // Maybe this used to be something to prevent audio popping? + // This is self-assignment, so redundant. Maybe this used to be something to prevent audio popping ? mixed_pcm_buffer[0] = mixed_pcm_buffer[0]; mixed_pcm_buffer[sample_count - 1] = mixed_pcm_buffer[sample_count - 1];