fix v2 visual checks again

This commit is contained in:
Martin Michelsen
2023-10-22 09:13:29 -07:00
parent d2d96d9c0a
commit c0740fd21f
+38 -44
View File
@@ -41,46 +41,43 @@ void PlayerDispDataDCPCV3::enforce_lobby_join_limits(GameVersion target_version)
uint16_t face;
uint16_t head;
uint16_t hair;
uint16_t hair_r;
uint16_t hair_g;
uint16_t hair_b;
};
static constexpr ClassMaxes v1_v2_class_maxes[14] = {
{0x0009, 0x0004, 0x0005, 0x0000, 0x0007, 0x0100, 0x0100, 0x0100},
{0x0009, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0009, 0x0000, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0009, 0x0004, 0x0005, 0x0000, 0x0007, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0009, 0x0000, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0009, 0x0000, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0009, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0009, 0x0004, 0x0005, 0x0000, 0x0007, 0x0100, 0x0100, 0x0100},
{0x0009, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0009, 0x0004, 0x0005, 0x0000, 0x0007},
{0x0009, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0000, 0x0009, 0x0000, 0x0005, 0x0000},
{0x0009, 0x0004, 0x0005, 0x0000, 0x0007},
{0x0000, 0x0009, 0x0000, 0x0005, 0x0000},
{0x0000, 0x0009, 0x0000, 0x0005, 0x0000},
{0x0009, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0009, 0x0004, 0x0005, 0x0000, 0x0007},
{0x0009, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
};
static constexpr ClassMaxes v3_v4_class_maxes[19] = {
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0019, 0x0000, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0019, 0x0000, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0019, 0x0000, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0019, 0x0000, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0100, 0x0100, 0x0100},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}};
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0000, 0x0019, 0x0000, 0x0005, 0x0000},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0000, 0x0019, 0x0000, 0x0005, 0x0000},
{0x0000, 0x0019, 0x0000, 0x0005, 0x0000},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0000, 0x0019, 0x0000, 0x0005, 0x0000},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0012, 0x0004, 0x0005, 0x0000, 0x000A},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0001},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0001},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
{0x0000, 0x0000, 0x0000, 0x0000, 0x0000}};
const ClassMaxes* maxes;
if ((target_version == GameVersion::PC) || (target_version == GameVersion::DC)) {
@@ -129,14 +126,11 @@ void PlayerDispDataDCPCV3::enforce_lobby_join_limits(GameVersion target_version)
}
// V1/V2 has fewer costumes and android skins, so substitute them here
this->visual.costume %= maxes->costume;
this->visual.skin %= maxes->skin;
this->visual.face %= maxes->face;
this->visual.head %= maxes->head;
this->visual.hair %= maxes->hair;
this->visual.hair_r %= maxes->hair_r;
this->visual.hair_g %= maxes->hair_g;
this->visual.hair_b %= maxes->hair_b;
this->visual.costume = maxes->costume ? (this->visual.costume % maxes->costume) : 0;
this->visual.skin = maxes->skin ? (this->visual.skin % maxes->skin) : 0;
this->visual.face = maxes->face ? (this->visual.face % maxes->face) : 0;
this->visual.head = maxes->head ? (this->visual.head % maxes->head) : 0;
this->visual.hair = maxes->hair ? (this->visual.hair % maxes->hair) : 0;
this->visual.compute_name_color_checksum();
this->visual.class_flags = class_flags_for_class(this->visual.char_class);