tracers: add option to only trace to players
This commit is contained in:
parent
88d1149d7e
commit
7383dc7853
@ -2272,3 +2272,5 @@ no_force_rotate (NoForceRotate) bool false
|
|||||||
enable_tracers (Tracers) bool false
|
enable_tracers (Tracers) bool false
|
||||||
|
|
||||||
no_slow (NoSlow) bool false
|
no_slow (NoSlow) bool false
|
||||||
|
|
||||||
|
trace_players_only (Only trace to players) bool true
|
||||||
|
@ -200,6 +200,11 @@ public:
|
|||||||
return m_prop.stepheight;
|
return m_prop.stepheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool isPlayer() const
|
||||||
|
{
|
||||||
|
return m_is_player;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool isLocalPlayer() const
|
inline bool isLocalPlayer() const
|
||||||
{
|
{
|
||||||
return m_is_local_player;
|
return m_is_local_player;
|
||||||
@ -276,6 +281,6 @@ public:
|
|||||||
{
|
{
|
||||||
return m_prop.infotext;
|
return m_prop.infotext;
|
||||||
}
|
}
|
||||||
|
|
||||||
float m_waiting_for_reattach;
|
float m_waiting_for_reattach;
|
||||||
};
|
};
|
||||||
|
@ -93,6 +93,7 @@ void set_default_settings(Settings *settings)
|
|||||||
settings->setDefault("no_force_rotate", "false");
|
settings->setDefault("no_force_rotate", "false");
|
||||||
settings->setDefault("enable_tracers", "false");
|
settings->setDefault("enable_tracers", "false");
|
||||||
settings->setDefault("no_slow", "false");
|
settings->setDefault("no_slow", "false");
|
||||||
|
settings->setDefault("trace_players_only", "true");
|
||||||
|
|
||||||
// Keymap
|
// Keymap
|
||||||
settings->setDefault("remote_port", "30000");
|
settings->setDefault("remote_port", "30000");
|
||||||
|
@ -22,6 +22,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#include "client/camera.h"
|
#include "client/camera.h"
|
||||||
#include "tracers.h"
|
#include "tracers.h"
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
|
#include "settings.h"
|
||||||
|
#include "client/content_cao.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
void Tracers::draw(video::IVideoDriver* driver, Client *client)
|
void Tracers::draw(video::IVideoDriver* driver, Client *client)
|
||||||
{
|
{
|
||||||
@ -36,6 +39,9 @@ void Tracers::draw(video::IVideoDriver* driver, Client *client)
|
|||||||
ClientActiveObject *obj = allObject.obj;
|
ClientActiveObject *obj = allObject.obj;
|
||||||
if (obj->isLocalPlayer() || obj->getParent())
|
if (obj->isLocalPlayer() || obj->getParent())
|
||||||
continue;
|
continue;
|
||||||
driver->draw3DLine(head_pos, obj->getPosition(), video::SColor(255, 255, 255, 255));
|
|
||||||
|
GenericCAO *cao = env.getGenericCAO(obj->getId());
|
||||||
|
if (!g_settings->getBool("trace_players_only") || (cao && cao->isPlayer()))
|
||||||
|
driver->draw3DLine(head_pos, obj->getPosition(), video::SColor(255, 255, 255, 255));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user