Match Jetski::HandleClick (#1380)

* Match `Jetski::HandleClick`

* Formatting

* Clean up, document, add BETA10 references

* Fix formatting

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz
2025-02-02 15:44:00 +01:00
committed by GitHub
parent dad44535bd
commit bc0344a8c4
6 changed files with 49 additions and 24 deletions

View File

@@ -157,27 +157,30 @@ MxLong DuneBuggy::HandlePathStruct(LegoPathStructNotificationParam& p_param)
}
// FUNCTION: LEGO1 0x10068290
// FUNCTION: BETA10 0x1002765d
MxS32 DuneBuggy::GetColorOffset(const char* p_variable)
{
MxS32 offset = 1;
const char* colorName = VariableTable()->GetVariable(p_variable);
const char* color = VariableTable()->GetVariable(p_variable);
assert(color);
if (strcmpi(colorName, "lego green")) {
if (!strcmpi(colorName, "lego red")) {
offset = 2;
}
else if (!strcmpi(colorName, "lego yellow")) {
offset = 3;
}
else if (!strcmpi(colorName, "lego black")) {
offset = 4;
}
else if (!strcmpi(colorName, "lego blue")) {
offset = 5;
}
else if (!strcmpi(colorName, "lego white")) {
offset = 6;
}
if (!strcmpi(color, "lego green")) {
offset = 1;
}
else if (!strcmpi(color, "lego red")) {
offset = 2;
}
else if (!strcmpi(color, "lego yellow")) {
offset = 3;
}
else if (!strcmpi(color, "lego black")) {
offset = 4;
}
else if (!strcmpi(color, "lego blue")) {
offset = 5;
}
else if (!strcmpi(color, "lego white")) {
offset = 6;
}
return offset;