Skip to content

Commit

Permalink
Merge branch 'master' into merge-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Desdaemon committed Nov 3, 2024
2 parents 97b51ac + 6592270 commit cc81c5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/battle_animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "spriteset_map.h"

BattleAnimation::BattleAnimation(const lcf::rpg::Animation& anim, bool only_sound, int cutoff, bool synced, bool multiplayer) :
Sprite(multiplayer ? Drawable::Flags::Shared : Drawable::Flags::Default), animation(anim), only_sound(only_sound), synced(synced), multiplayer(multiplayer)
animation(anim), only_sound(only_sound), synced(synced), multiplayer(multiplayer)
{
num_frames = GetRealFrames() * 2;
if (cutoff >= 0 && cutoff < num_frames) {
Expand Down
5 changes: 5 additions & 0 deletions src/multiplayer/game_multiplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,12 @@ void Game_Multiplayer::InitConnection() {
if (players.find(p.id) == players.end()) return;
const lcf::rpg::Animation* anim = lcf::ReaderUtil::GetElement(lcf::Data::animations, p.anim_id);
if (anim) {
auto scene_map = Scene::Find(Scene::SceneType::Map);
if (!scene_map) return;
auto old_list = &DrawableMgr::GetLocalList();
DrawableMgr::SetLocalList(&scene_map->GetDrawableList());
players[p.id].battle_animation.reset(new BattleAnimationMap(*anim, *players[p.id].ch, false, true, true));
DrawableMgr::SetLocalList(old_list);
} else {
players[p.id].battle_animation.reset();
}
Expand Down

0 comments on commit cc81c5f

Please sign in to comment.