split disp data into stats and visual substructures
This commit is contained in:
+16
-16
@@ -735,51 +735,51 @@ static void server_command_edit(shared_ptr<ServerState> s, shared_ptr<Lobby> l,
|
||||
|
||||
try {
|
||||
if (tokens.at(0) == "atp") {
|
||||
c->game_data.player()->disp.stats.atp = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.char_stats.atp = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "mst") {
|
||||
c->game_data.player()->disp.stats.mst = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.char_stats.mst = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "evp") {
|
||||
c->game_data.player()->disp.stats.evp = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.char_stats.evp = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "hp") {
|
||||
c->game_data.player()->disp.stats.hp = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.char_stats.hp = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "dfp") {
|
||||
c->game_data.player()->disp.stats.dfp = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.char_stats.dfp = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "ata") {
|
||||
c->game_data.player()->disp.stats.ata = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.char_stats.ata = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "lck") {
|
||||
c->game_data.player()->disp.stats.lck = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.char_stats.lck = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "meseta") {
|
||||
c->game_data.player()->disp.meseta = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.meseta = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "exp") {
|
||||
c->game_data.player()->disp.experience = stoul(tokens.at(1));
|
||||
c->game_data.player()->disp.stats.experience = stoul(tokens.at(1));
|
||||
} else if (tokens.at(0) == "level") {
|
||||
c->game_data.player()->disp.level = stoul(tokens.at(1)) - 1;
|
||||
c->game_data.player()->disp.stats.level = stoul(tokens.at(1)) - 1;
|
||||
} else if (tokens.at(0) == "namecolor") {
|
||||
uint32_t new_color;
|
||||
sscanf(tokens.at(1).c_str(), "%8X", &new_color);
|
||||
c->game_data.player()->disp.name_color = new_color;
|
||||
c->game_data.player()->disp.visual.name_color = new_color;
|
||||
} else if (tokens.at(0) == "secid") {
|
||||
uint8_t secid = section_id_for_name(decode_sjis(tokens.at(1)));
|
||||
if (secid == 0xFF) {
|
||||
send_text_message(c, u"$C6No such section ID");
|
||||
return;
|
||||
} else {
|
||||
c->game_data.player()->disp.section_id = secid;
|
||||
c->game_data.player()->disp.visual.section_id = secid;
|
||||
}
|
||||
} else if (tokens.at(0) == "name") {
|
||||
c->game_data.player()->disp.name = add_language_marker(tokens.at(1), 'J');
|
||||
} else if (tokens.at(0) == "npc") {
|
||||
if (tokens.at(1) == "none") {
|
||||
c->game_data.player()->disp.extra_model = 0;
|
||||
c->game_data.player()->disp.v2_flags &= 0xFD;
|
||||
c->game_data.player()->disp.visual.extra_model = 0;
|
||||
c->game_data.player()->disp.visual.v2_flags &= 0xFD;
|
||||
} else {
|
||||
uint8_t npc = npc_for_name(decode_sjis(tokens.at(1)));
|
||||
if (npc == 0xFF) {
|
||||
send_text_message(c, u"$C6No such NPC");
|
||||
return;
|
||||
}
|
||||
c->game_data.player()->disp.extra_model = npc;
|
||||
c->game_data.player()->disp.v2_flags |= 0x02;
|
||||
c->game_data.player()->disp.visual.extra_model = npc;
|
||||
c->game_data.player()->disp.visual.v2_flags |= 0x02;
|
||||
}
|
||||
} else if (tokens.at(0) == "tech") {
|
||||
uint8_t level = stoul(tokens.at(2)) - 1;
|
||||
|
||||
Reference in New Issue
Block a user