Fix addon karts display of online games
This commit is contained in:
parent
7763d851be
commit
b59c65e989
@ -10,6 +10,7 @@
|
|||||||
#include "tracks/track_manager.hpp"
|
#include "tracks/track_manager.hpp"
|
||||||
#include "tracks/track.hpp"
|
#include "tracks/track.hpp"
|
||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
|
#include "karts/kart_model.hpp"
|
||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
#include "utils/translation.hpp"
|
#include "utils/translation.hpp"
|
||||||
#include "network/protocols/client_lobby.hpp"
|
#include "network/protocols/client_lobby.hpp"
|
||||||
@ -468,7 +469,7 @@ void RichPresence::update(bool force)
|
|||||||
AbstractKart *abstractKart = world->getLocalPlayerKart(0);
|
AbstractKart *abstractKart = world->getLocalPlayerKart(0);
|
||||||
if (abstractKart)
|
if (abstractKart)
|
||||||
{
|
{
|
||||||
const KartProperties* kart = abstractKart->getKartProperties();
|
const KartProperties* kart = abstractKart->getKartModel()->getKartProperties();
|
||||||
assets.add("small_image", protocol && protocol->isSpectator() ?
|
assets.add("small_image", protocol && protocol->isSpectator() ?
|
||||||
"spectate" : kart->isAddon() ?
|
"spectate" : kart->isAddon() ?
|
||||||
"addons" : "kart_" + abstractKart->getIdent());
|
"addons" : "kart_" + abstractKart->getIdent());
|
||||||
|
@ -132,6 +132,7 @@ KartModel::KartModel(bool is_master)
|
|||||||
m_animation_speed = 25;
|
m_animation_speed = 25;
|
||||||
m_current_animation = AF_DEFAULT;
|
m_current_animation = AF_DEFAULT;
|
||||||
m_support_colorization = false;
|
m_support_colorization = false;
|
||||||
|
m_kart_properties = NULL;
|
||||||
} // KartModel
|
} // KartModel
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@ -324,6 +325,7 @@ KartModel* KartModel::makeCopy(std::shared_ptr<RenderInfo> ri)
|
|||||||
assert(m_is_master);
|
assert(m_is_master);
|
||||||
assert(!m_render_info);
|
assert(!m_render_info);
|
||||||
assert(!m_animated_node);
|
assert(!m_animated_node);
|
||||||
|
assert(m_kart_properties);
|
||||||
KartModel *km = new KartModel(/*is master*/ false);
|
KartModel *km = new KartModel(/*is master*/ false);
|
||||||
km->m_kart_width = m_kart_width;
|
km->m_kart_width = m_kart_width;
|
||||||
km->m_kart_length = m_kart_length;
|
km->m_kart_length = m_kart_length;
|
||||||
@ -384,6 +386,7 @@ KartModel* KartModel::makeCopy(std::shared_ptr<RenderInfo> ri)
|
|||||||
for(unsigned int i=AF_BEGIN; i<=AF_END; i++)
|
for(unsigned int i=AF_BEGIN; i<=AF_END; i++)
|
||||||
km->m_animation_frame[i] = m_animation_frame[i];
|
km->m_animation_frame[i] = m_animation_frame[i];
|
||||||
|
|
||||||
|
km->m_kart_properties = m_kart_properties;
|
||||||
return km;
|
return km;
|
||||||
} // makeCopy
|
} // makeCopy
|
||||||
|
|
||||||
@ -563,6 +566,7 @@ void HeadlightObject::setLight(scene::ISceneNode* parent,
|
|||||||
bool KartModel::loadModels(const KartProperties &kart_properties)
|
bool KartModel::loadModels(const KartProperties &kart_properties)
|
||||||
{
|
{
|
||||||
assert(m_is_master);
|
assert(m_is_master);
|
||||||
|
m_kart_properties = &kart_properties;
|
||||||
std::string full_path = kart_properties.getKartDir()+m_model_filename;
|
std::string full_path = kart_properties.getKartDir()+m_model_filename;
|
||||||
// For b3d loader only
|
// For b3d loader only
|
||||||
if (m_animation_frame[AF_STRAIGHT] > -1)
|
if (m_animation_frame[AF_STRAIGHT] > -1)
|
||||||
|
@ -323,6 +323,7 @@ private:
|
|||||||
/** Exhaust particle file (xml) for the kart, empty if disabled. */
|
/** Exhaust particle file (xml) for the kart, empty if disabled. */
|
||||||
std::string m_exhaust_xml;
|
std::string m_exhaust_xml;
|
||||||
|
|
||||||
|
const KartProperties* m_kart_properties;
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
void initInverseBoneMatrices();
|
void initInverseBoneMatrices();
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
@ -451,5 +452,8 @@ public:
|
|||||||
const std::string& getExhaustXML() const { return m_exhaust_xml; }
|
const std::string& getExhaustXML() const { return m_exhaust_xml; }
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
bool hasWheel() const { return !m_wheel_filename[0].empty(); }
|
bool hasWheel() const { return !m_wheel_filename[0].empty(); }
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
const KartProperties* getKartProperties() const
|
||||||
|
{ return m_kart_properties; }
|
||||||
}; // KartModel
|
}; // KartModel
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user