Merge pull request #1180 from noudess/boat

Allow boats flymode to be overridden by local db
This commit is contained in:
Chris Miles 2021-01-21 18:26:05 -06:00 committed by GitHub
commit ca98ea9872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -1197,10 +1197,6 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
else
ns->spawn.flymode = flymode;
if(IsBoat()) {
ns->spawn.flymode = GravityBehavior::Floating;
}
ns->spawn.lastName[0] = '\0';
strn0cpy(ns->spawn.lastName, lastname, sizeof(ns->spawn.lastName));

View File

@ -230,9 +230,14 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
adventure_template_id = npc_type_data->adventure_template;
flymode = iflymode;
// If server has set a flymode in db honor it over all else.
// If server has not set a flymde in db, and this is a boat - force floating.
if (npc_type_data->flymode >= 0) {
flymode = static_cast<GravityBehavior>(npc_type_data->flymode);
}
else if (IsBoat()) {
flymode = GravityBehavior::Floating;
}
guard_anim = eaStanding;
roambox_distance = 0;