]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Added Tracers, NoSlow and NoForceRotate; GUI Colors changed
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 4 Oct 2020 15:43:37 +0000 (17:43 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 4 Oct 2020 15:43:37 +0000 (17:43 +0200)
26 files changed:
builtin/client/cheats.lua
builtin/settingtypes.txt
src/client/client.cpp
src/client/content_cao.cpp
src/client/game.cpp
src/client/localplayer.cpp
src/client/localplayer.h
src/client/render/core.cpp
src/client/render/core.h
src/client/render/factory.cpp
src/client/render/factory.h
src/client/render/interlaced.cpp
src/client/render/interlaced.h
src/client/render/plain.cpp
src/client/render/plain.h
src/client/render/sidebyside.cpp
src/client/render/sidebyside.h
src/client/render/stereo.cpp
src/client/render/stereo.h
src/client/renderingengine.cpp
src/client/renderingengine.h
src/defaultsettings.cpp
src/gui/cheatMenu.h
src/gui/tracers.cpp
src/gui/tracers.h
src/network/clientpackethandler.cpp

index a6aa13dc7953df6f7e3f43d49767abfd1b407ac2..43d79d49829c2ac72c9e73b182a69772a17730b1 100644 (file)
@@ -11,6 +11,8 @@ core.cheats = {
                ["PitchMove"] = "pitch_move",
                ["AutoJump"] = "autojump",
                ["Jesus"] = "jesus",
+               ["NoSlow"] = "no_slow",
+               
        },
        ["Render"] = {
                ["Xray"] = "xray",
@@ -19,6 +21,7 @@ core.cheats = {
                ["NoHurtCam"] = "no_hurt_cam",
                ["BrightNight"] = "no_night",
                ["Coords"] = "coords",
+               ["Tracers"] = "enable_tracers",
        },
        ["World"] = {
                ["FastDig"] = "fastdig",
@@ -36,6 +39,7 @@ core.cheats = {
        },
        ["Player"] = {
                ["NoFallDamage"] = "prevent_natural_damage",
+               ["NoForceRotate"] = "no_force_rotate",
        },
 }
 
index e076ac2ea779e819f8251a8d36fb5a4ac91a333b..8452850fab9d07f7ea1d3288428c23dce5f7aa0f 100644 (file)
@@ -2262,3 +2262,13 @@ no_night (BrightNight) bool false
 coords (Coords) bool false
 
 point_liquids (PointLiquids) bool false
+
+log_particles (ParticleExploit) bool false
+
+spamclick (FastHit) bool false
+
+no_force_rotate (NoForceRotate) bool false
+
+enable_tracers (Tracers) bool false
+
+no_slow (NoSlow) bool false
index db80beb9f882ffdc0f81164fd97b4dca47cedcc6..d65dc510fa7645b2cf50d3bdcdae5a4663110225 100644 (file)
@@ -932,9 +932,9 @@ void Client::Send(NetworkPacket* pkt)
 
 // Will fill up 12 + 12 + 4 + 4 + 4 bytes
 void writePlayerPos(LocalPlayer *myplayer, ClientMap *clientMap, NetworkPacket *pkt)
-{
-       v3f pf           = myplayer->getPosition() * 100;
-       v3f sf           = myplayer->getSpeed() * 100;
+{      
+       v3f pf           = myplayer->getLegitPosition() * 100;
+       v3f sf           = myplayer->getLegitSpeed() * 100;
        s32 pitch        = myplayer->getPitch() * 100;
        s32 yaw          = myplayer->getYaw() * 100;
        u32 keyPressed   = myplayer->keyPressed;
index 2a3225b7a8e727cd764f25ab53486559265e830c..cf671d5ca942001bd6548dfc623e28d0af90fb08 100644 (file)
@@ -891,7 +891,7 @@ u16 GenericCAO::getLightPosition(v3s16 *pos)
 
 void GenericCAO::updateNametag()
 {
-       if (m_is_local_player) // No nametag for local player
+       if (m_is_local_player && ! g_settings->getBool("freecam")) // No nametag for local player
                return;
 
        if (m_prop.nametag.empty()) {
@@ -943,12 +943,14 @@ void GenericCAO::updateNodePos()
 void GenericCAO::step(float dtime, ClientEnvironment *env)
 {
        // Handle model animations and update positions instantly to prevent lags
-       if (m_is_local_player && ! g_settings->getBool("freecam")) {
+       if (m_is_local_player) {
                LocalPlayer *player = m_env->getLocalPlayer();
-               m_position = player->getPosition();
+               m_position = player->getLegitPosition();
                pos_translator.val_current = m_position;
-               m_rotation.Y = wrapDegrees_0_360(player->getYaw());
-               rot_translator.val_current = m_rotation;
+               if (! g_settings->getBool("freecam")) {
+                       m_rotation.Y = wrapDegrees_0_360(player->getYaw());
+                       rot_translator.val_current = m_rotation;
+               }
 
                if (m_is_visible) {
                        int old_anim = player->last_animation;
@@ -958,9 +960,9 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
                        const PlayerControl &controls = player->getPlayerControl();
 
                        bool walking = false;
-                       if (controls.up || controls.down || controls.left || controls.right ||
+                       if ((controls.up || controls.down || controls.left || controls.right ||
                                        controls.forw_move_joystick_axis != 0.f ||
-                                       controls.sidew_move_joystick_axis != 0.f)
+                                       controls.sidew_move_joystick_axis != 0.f) && ! g_settings->getBool("freecam"))
                                walking = true;
 
                        f32 new_speed = player->local_animation_speed;
@@ -976,7 +978,7 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
                                        m_client->checkLocalPrivilege("fly"))))
                                        new_speed *= 1.5;
                        // slowdown speed if sneeking
-                       if (controls.sneak && walking)
+                       if (controls.sneak && walking && ! g_settings->getBool("no_slow"))
                                new_speed /= 2;
 
                        if (walking && (controls.LMB || controls.RMB)) {
index ba360a1534d8cbd468438c8df346fc9d3ce0b6d8..c1f1ea4a1040d175b8643eb1df12406b9eb8b76d 100644 (file)
@@ -228,7 +228,7 @@ bool Game::startup(bool *kill,
        if (!createClient(start_data))
                return false;
 
-       RenderingEngine::initialize(client, hud);
+       RenderingEngine::initialize(client, hud, m_tracers);
 
        return true;
 }
@@ -3196,7 +3196,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
        }
 #endif
        RenderingEngine::draw_scene(skycolor, m_game_ui->m_flags.show_hud,
-                       m_game_ui->m_flags.show_minimap, draw_wield_tool, draw_crosshair);
+                       m_game_ui->m_flags.show_minimap, draw_wield_tool, draw_crosshair, g_settings->getBool("enable_tracers"));
 
        /*
                Profiler graph
@@ -3211,12 +3211,6 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
        if (m_game_ui->m_flags.show_cheat_menu && ! gui_chat_console->isOpen())
                m_cheat_menu->draw(driver, m_game_ui->m_flags.show_debug);
                
-       /*
-               Tracers
-       */
-
-               m_tracers->draw(driver);
-
        /*
                Damage flash
        */
@@ -3234,7 +3228,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
        if (player->hurt_tilt_timer > 0.0f) {
                player->hurt_tilt_timer -= dtime * 6.0f;
 
-               if (player->hurt_tilt_timer < 0.0f)
+               if (player->hurt_tilt_timer < 0.0f || g_settings->getBool("no_hurt_cam"))
                        player->hurt_tilt_strength = 0.0f;
        }
 
@@ -3249,6 +3243,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
        /*
                End scene
        */
+       
        driver->endScene();
 
        stats->drawtime = tt_draw.stop(true);
@@ -3334,15 +3329,11 @@ void Game::freecamChangedCallback(const std::string &setting_name, void *data)
 {
        Game *game = (Game *) data;
        LocalPlayer *player = game->client->getEnv().getLocalPlayer();
-       static v3f player_pos = player->getPosition();
-       static v3f player_speed = player->getSpeed();
        if (g_settings->getBool("freecam")) {
-               player_pos = player->getPosition();
-               player_speed = player->getSpeed();
                game->camera->setCameraMode(CAMERA_MODE_FIRST);
+               player->freecamEnable();
        } else {
-               player->setPosition(player_pos);
-               player->setSpeed(player_speed);
+               player->freecamDisable();
        }
        game->updatePlayerCAOVisibility();
 }
index 958c07f5c7151840564e387ea9fdfb2e2b0a96e2..9c1e896af5a70aeeb841e69b5a5e45657b2d8f3f 100644 (file)
@@ -461,6 +461,8 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
                        m_speed.Y += jumpspeed;
                }
                setSpeed(m_speed);
+               if (! m_freecam)
+                       m_legit_speed = m_speed;
                m_can_jump = false;
        }
 
@@ -639,7 +641,7 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
        if (superspeed || (is_climbing && fast_climb) ||
                        ((in_liquid || in_liquid_stable) && fast_climb))
                speedH = speedH.normalize() * movement_speed_fast;
-       else if (control.sneak && !free_move && !in_liquid && !in_liquid_stable)
+       else if (control.sneak && !free_move && !in_liquid && !in_liquid_stable && !g_settings->getBool("no_slow"))
                speedH = speedH.normalize() * movement_speed_crouch;
        else
                speedH = speedH.normalize() * movement_speed_walk;
index e2ddb3c87a540e3be2976d082202be82f9d84910..0e071d2b4862a0eb117bbce618c2a831b4a08118 100644 (file)
@@ -132,11 +132,37 @@ class LocalPlayer : public Player
        inline void setPosition(const v3f &position)
        {
                m_position = position;
+               if (! m_freecam)
+                       m_legit_position = position;
                m_sneak_node_exists = false;
        }
 
        v3f getPosition() const { return m_position; }
 
+       v3f getLegitPosition() const { return m_legit_position; }
+       
+       v3f getLegitSpeed() const { return m_legit_speed; }
+
+       inline void setLegitPosition(const v3f &position)
+       {
+               if (m_freecam)
+                       m_legit_position = position;
+               else
+                       setPosition(position);
+       }
+
+       inline void freecamEnable() 
+       {
+               m_freecam = true;
+       }
+       
+       inline void freecamDisable() 
+       {
+               m_freecam = false;
+               setPosition(m_legit_position);
+               setSpeed(m_legit_speed);
+       }
+       
        // Non-transformed eye offset getters
        // For accurate positions, use the Camera functions
        v3f getEyePosition() const { return m_position + getEyeOffset(); }
@@ -175,7 +201,10 @@ class LocalPlayer : public Player
                const v3f &position_before_move, const v3f &speed_before_move,
                f32 pos_max_d);
 
+       bool m_freecam = false;
        v3f m_position;
+       v3f m_legit_position;
+       v3f m_legit_speed;
        v3s16 m_standing_node;
 
        v3s16 m_sneak_node = v3s16(32767, 32767, 32767);
index 92a7137eaa7fea99388f0cf2c137d7f11cb60750..3c5aa8eff9edf5cfdbb561a62dd0ae88cf6d2459 100644 (file)
@@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "client/clientmap.h"
 #include "client/hud.h"
 #include "client/minimap.h"
+#include "gui/tracers.h"
 
-RenderingCore::RenderingCore(IrrlichtDevice *_device, Client *_client, Hud *_hud)
+RenderingCore::RenderingCore(IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers)
        : device(_device), driver(device->getVideoDriver()), smgr(device->getSceneManager()),
        guienv(device->getGUIEnvironment()), client(_client), camera(client->getCamera()),
-       mapper(client->getMinimap()), hud(_hud)
+       mapper(client->getMinimap()), hud(_hud), tracers(_tracers)
 {
        screensize = driver->getScreenSize();
        virtual_size = screensize;
@@ -53,7 +54,7 @@ void RenderingCore::updateScreenSize()
 }
 
 void RenderingCore::draw(video::SColor _skycolor, bool _show_hud, bool _show_minimap,
-               bool _draw_wield_tool, bool _draw_crosshair)
+               bool _draw_wield_tool, bool _draw_crosshair, bool _draw_tracers)
 {
        v2u32 ss = driver->getScreenSize();
        if (screensize != ss) {
@@ -65,6 +66,7 @@ void RenderingCore::draw(video::SColor _skycolor, bool _show_hud, bool _show_min
        show_minimap = _show_minimap;
        draw_wield_tool = _draw_wield_tool;
        draw_crosshair = _draw_crosshair;
+       draw_tracers = _draw_tracers;
 
        beforeDraw();
        drawAll();
@@ -72,11 +74,14 @@ void RenderingCore::draw(video::SColor _skycolor, bool _show_hud, bool _show_min
 
 void RenderingCore::draw3D()
 {
+       
        smgr->drawAll();
        driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
        if (!show_hud)
                return;
        hud->drawSelectionMesh();
+       if (draw_tracers)
+               tracers->draw(driver, client);
        if (draw_wield_tool)
                camera->drawWieldedTool();
 }
index 52ea8f99f71c7b8bc335ec472a91e33593a88667..89c6a85113b320c859f980852ca169cd11fe6856 100644 (file)
@@ -25,6 +25,7 @@ class Camera;
 class Client;
 class Hud;
 class Minimap;
+class Tracers;
 
 class RenderingCore
 {
@@ -36,6 +37,7 @@ class RenderingCore
        bool show_minimap;
        bool draw_wield_tool;
        bool draw_crosshair;
+       bool draw_tracers;
 
        IrrlichtDevice *device;
        video::IVideoDriver *driver;
@@ -46,6 +48,7 @@ class RenderingCore
        Camera *camera;
        Minimap *mapper;
        Hud *hud;
+       Tracers *tracers;
 
        void updateScreenSize();
        virtual void initTextures() {}
@@ -59,7 +62,7 @@ class RenderingCore
        void drawPostFx();
 
 public:
-       RenderingCore(IrrlichtDevice *_device, Client *_client, Hud *_hud);
+       RenderingCore(IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers);
        RenderingCore(const RenderingCore &) = delete;
        RenderingCore(RenderingCore &&) = delete;
        virtual ~RenderingCore();
@@ -69,7 +72,7 @@ class RenderingCore
 
        void initialize();
        void draw(video::SColor _skycolor, bool _show_hud, bool _show_minimap,
-                       bool _draw_wield_tool, bool _draw_crosshair);
+                       bool _draw_wield_tool, bool _draw_crosshair, bool _draw_tracers);
 
        inline v2u32 getVirtualSize() const { return virtual_size; }
 };
index 30f9480fcf44d343437aff8f9eaab13b72385230..06376742de0ddbc4f034aeb107f07ad42425f5a0 100644 (file)
@@ -27,23 +27,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "sidebyside.h"
 
 RenderingCore *createRenderingCore(const std::string &stereo_mode, IrrlichtDevice *device,
-               Client *client, Hud *hud)
+               Client *client, Hud *hud, Tracers *tracers)
 {
        if (stereo_mode == "none")
-               return new RenderingCorePlain(device, client, hud);
+               return new RenderingCorePlain(device, client, hud, tracers);
        if (stereo_mode == "anaglyph")
-               return new RenderingCoreAnaglyph(device, client, hud);
+               return new RenderingCoreAnaglyph(device, client, hud, tracers);
        if (stereo_mode == "interlaced")
-               return new RenderingCoreInterlaced(device, client, hud);
+               return new RenderingCoreInterlaced(device, client, hud, tracers);
 #ifdef STEREO_PAGEFLIP_SUPPORTED
        if (stereo_mode == "pageflip")
-               return new RenderingCorePageflip(device, client, hud);
+               return new RenderingCorePageflip(device, client, hud, tracers);
 #endif
        if (stereo_mode == "sidebyside")
-               return new RenderingCoreSideBySide(device, client, hud);
+               return new RenderingCoreSideBySide(device, client, hud, tracers);
        if (stereo_mode == "topbottom")
-               return new RenderingCoreSideBySide(device, client, hud, true);
+               return new RenderingCoreSideBySide(device, client, hud, tracers, true);
        if (stereo_mode == "crossview")
-               return new RenderingCoreSideBySide(device, client, hud, false, true);
+               return new RenderingCoreSideBySide(device, client, hud, tracers, false, true);
        throw std::invalid_argument("Invalid rendering mode: " + stereo_mode);
 }
index e3339a836e5d3f824e966a1d77f683b027faa52d..cd1845bd20e32e741fe1b405b0c0474a739296f7 100644 (file)
@@ -24,4 +24,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "core.h"
 
 RenderingCore *createRenderingCore(const std::string &stereo_mode, IrrlichtDevice *device,
-               Client *client, Hud *hud);
+               Client *client, Hud *hud, Tracers *tracers);
index 2aadadc17a785fdee2a79ba46135c4d88ca2eb7b..ae9d0d3589784e6437b1d9a4dc14e4bc83409028 100644 (file)
@@ -24,8 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "client/tile.h"
 
 RenderingCoreInterlaced::RenderingCoreInterlaced(
-       IrrlichtDevice *_device, Client *_client, Hud *_hud)
-       : RenderingCoreStereo(_device, _client, _hud)
+       IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers)
+       : RenderingCoreStereo(_device, _client, _hud, _tracers)
 {
        initMaterial();
 }
index 71815fd707d7297d30dd40553219b279b624fe9d..94ccc61f83e85c45732f0e74f67847e766f4719a 100644 (file)
@@ -38,6 +38,6 @@ class RenderingCoreInterlaced : public RenderingCoreStereo
        void merge();
 
 public:
-       RenderingCoreInterlaced(IrrlichtDevice *_device, Client *_client, Hud *_hud);
+       RenderingCoreInterlaced(IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers);
        void drawAll() override;
 };
index a130a14eb0256a6d926e1587873aa2471bb16119..f1966a4b2105d65182a63b2ffa07ba1f7d5b45ce 100644 (file)
@@ -27,8 +27,8 @@ inline u32 scaledown(u32 coef, u32 size)
 }
 
 RenderingCorePlain::RenderingCorePlain(
-       IrrlichtDevice *_device, Client *_client, Hud *_hud)
-       : RenderingCore(_device, _client, _hud)
+       IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers)
+       : RenderingCore(_device, _client, _hud, _tracers)
 {
        scale = g_settings->getU16("undersampling");
 }
index 80c17ed9f96daf511ebc3374a1214f8f4edf3347..afac62dee7c1978332699d4abb37b4a6cd1913e3 100644 (file)
@@ -33,6 +33,6 @@ class RenderingCorePlain : public RenderingCore
        void upscale();
 
 public:
-       RenderingCorePlain(IrrlichtDevice *_device, Client *_client, Hud *_hud);
+       RenderingCorePlain(IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers);
        void drawAll() override;
 };
index ed08810db2627f968b9e9be6aa8051472597d296..1b86fff3e3fd7dd1a2190ba138da27cc3186e062 100644 (file)
@@ -23,8 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "client/hud.h"
 
 RenderingCoreSideBySide::RenderingCoreSideBySide(
-       IrrlichtDevice *_device, Client *_client, Hud *_hud, bool _horizontal, bool _flipped)
-       : RenderingCoreStereo(_device, _client, _hud), horizontal(_horizontal), flipped(_flipped)
+       IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers, bool _horizontal, bool _flipped)
+       : RenderingCoreStereo(_device, _client, _hud, _tracers), horizontal(_horizontal), flipped(_flipped)
 {
 }
 
index f8ed256b3aefd1a86e9c0187dad433e5285b7285..10c3919d1b9e0779cb73b96d126a4649be70c2d2 100644 (file)
@@ -37,7 +37,7 @@ class RenderingCoreSideBySide : public RenderingCoreStereo
        void resetEye() override;
 
 public:
-       RenderingCoreSideBySide(IrrlichtDevice *_device, Client *_client, Hud *_hud,
+       RenderingCoreSideBySide(IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers,
                        bool _horizontal = false, bool _flipped = false);
        void drawAll() override;
 };
index 967b5a78f57132ee969589c361b943cbcd0f54f0..d826eca5928f0fd7b2646e39d387cc96e02d0567 100644 (file)
@@ -24,8 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "settings.h"
 
 RenderingCoreStereo::RenderingCoreStereo(
-       IrrlichtDevice *_device, Client *_client, Hud *_hud)
-       : RenderingCore(_device, _client, _hud)
+       IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers)
+       : RenderingCore(_device, _client, _hud, _tracers)
 {
        eye_offset = BS * g_settings->getFloat("3d_paralax_strength");
 }
index c8b07e146b4ceeddff6460fed4b692a29f799f1b..3494f2512758e5443929a3871d8c66ece770c58c 100644 (file)
@@ -34,5 +34,5 @@ class RenderingCoreStereo : public RenderingCore
        void renderBothImages();
 
 public:
-       RenderingCoreStereo(IrrlichtDevice *_device, Client *_client, Hud *_hud);
+       RenderingCoreStereo(IrrlichtDevice *_device, Client *_client, Hud *_hud, Tracers *_tracers);
 };
index f5aca8f58f82a82b514f80995b879d3a83fc4555..9572d260c32aad44edf7d4d84b93ecbab07da2c9 100644 (file)
@@ -591,10 +591,10 @@ std::vector<irr::video::E_DRIVER_TYPE> RenderingEngine::getSupportedVideoDrivers
        return drivers;
 }
 
-void RenderingEngine::_initialize(Client *client, Hud *hud)
+void RenderingEngine::_initialize(Client *client, Hud *hud, Tracers *tracers)
 {
        const std::string &draw_mode = g_settings->get("3d_mode");
-       core.reset(createRenderingCore(draw_mode, m_device, client, hud));
+       core.reset(createRenderingCore(draw_mode, m_device, client, hud, tracers));
        core->initialize();
 }
 
@@ -604,9 +604,9 @@ void RenderingEngine::_finalize()
 }
 
 void RenderingEngine::_draw_scene(video::SColor skycolor, bool show_hud,
-               bool show_minimap, bool draw_wield_tool, bool draw_crosshair)
+               bool show_minimap, bool draw_wield_tool, bool draw_crosshair, bool draw_tracers)
 {
-       core->draw(skycolor, show_hud, show_minimap, draw_wield_tool, draw_crosshair);
+       core->draw(skycolor, show_hud, show_minimap, draw_wield_tool, draw_crosshair, draw_tracers);
 }
 
 const char *RenderingEngine::getVideoDriverName(irr::video::E_DRIVER_TYPE type)
index 34cc606300e098fc90c80b1430466c718c4d2aeb..84ff4328d245394551176d5d23f695b3886d4449 100644 (file)
@@ -32,6 +32,7 @@ class Client;
 class LocalPlayer;
 class Hud;
 class Minimap;
+class Tracers;
 
 class RenderingCore;
 
@@ -117,15 +118,15 @@ class RenderingEngine
        }
 
        inline static void draw_scene(video::SColor skycolor, bool show_hud,
-                       bool show_minimap, bool draw_wield_tool, bool draw_crosshair)
+                       bool show_minimap, bool draw_wield_tool, bool draw_crosshair, bool draw_tracers)
        {
                s_singleton->_draw_scene(skycolor, show_hud, show_minimap,
-                               draw_wield_tool, draw_crosshair);
+                               draw_wield_tool, draw_crosshair, draw_tracers);
        }
 
-       inline static void initialize(Client *client, Hud *hud)
+       inline static void initialize(Client *client, Hud *hud, Tracers *tracers)
        {
-               s_singleton->_initialize(client, hud);
+               s_singleton->_initialize(client, hud, tracers);
        }
 
        inline static void finalize() { s_singleton->_finalize(); }
@@ -148,9 +149,9 @@ class RenderingEngine
                        bool clouds = true);
 
        void _draw_scene(video::SColor skycolor, bool show_hud, bool show_minimap,
-                       bool draw_wield_tool, bool draw_crosshair);
+                       bool draw_wield_tool, bool draw_crosshair, bool draw_tracers);
 
-       void _initialize(Client *client, Hud *hud);
+       void _initialize(Client *client, Hud *hud, Tracers *tracers);
 
        void _finalize();
 
index a22b6b8517b20f2ab69f568e8990daf9d6ecdaef..abe15c453d91860c3f14df1d2376a10f28acd5f0 100644 (file)
@@ -90,6 +90,9 @@ void set_default_settings(Settings *settings)
        settings->setDefault("point_liquids", "false");
        settings->setDefault("log_particles", "false");
        settings->setDefault("spamclick", "false");
+       settings->setDefault("no_force_rotate", "false");
+       settings->setDefault("enable_tracers", "false");
+       settings->setDefault("no_slow", "false");
        
        // Keymap
        settings->setDefault("remote_port", "30000");
index a2c8a2856ec6fa9dfabfd53e405cbf7b69d46e5f..aaa433cebfcec469c671b14e1a1ae51593a49ba7 100644 (file)
@@ -59,10 +59,11 @@ class CheatMenu
        int m_entry_width = 200;
        int m_gap = 3;
        
-       video::SColor m_bg_color = video::SColor(192, 255, 175, 191);
-       video::SColor m_active_bg_color = video::SColor(192, 255, 32, 76);
+       video::SColor m_bg_color = video::SColor(192, 255, 145, 88);
+       video::SColor m_active_bg_color = video::SColor(192, 255, 87, 53);
        video::SColor m_font_color = video::SColor(255, 0, 0, 0);
-       video::SColor m_selected_font_color = video::SColor(255, 250, 32, 129); 
+       video::SColor m_selected_font_color = video::SColor(255, 255, 252, 88); 
+
        
        Client *m_client;
        
index 6bcbff5464c5e94cf4d6c3d0b31f0b3afe0d42ec..34a6101ea178695783b4f268a463d635ead64680 100644 (file)
@@ -17,10 +17,25 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */ 
 
+#include <vector>
+#include "client/client.h"
+#include "client/camera.h"
 #include "tracers.h" 
 #include "constants.h"
 
-void Tracers::draw(video::IVideoDriver* driver)
+void Tracers::draw(video::IVideoDriver* driver, Client *client)
 {
-       driver->draw3DLine(v3f(0, 0, 0), v3f(1000, 1000, 1000) * BS, video::SColor(255, 0, 0, 0));
+       ClientEnvironment &env = client->getEnv();
+       LocalPlayer *player = env.getLocalPlayer();
+       Camera *camera = client->getCamera();
+       v3f player_pos = camera->getPosition() + camera->getDirection();
+       v3f head_pos = player_pos;
+       std::vector<DistanceSortedActiveObject> allObjects;
+       env.getActiveObjects(player_pos, 1000000, allObjects);
+       for (const auto &allObject : allObjects) {
+               ClientActiveObject *obj = allObject.obj;
+               if (obj->isLocalPlayer())
+                       continue;
+               driver->draw3DLine(head_pos, obj->getPosition(), video::SColor(255, 255, 255, 255));
+       }
 }
index ae987ddf0ae5a4fe25b04b33f52bb9fd2642bdb4..0ad17ad7950f5e4534e7d3ca2439d9fb77fb00d6 100644 (file)
@@ -24,5 +24,5 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 class Tracers
 {
 public:
-       void draw(video::IVideoDriver* driver);
+       void draw(video::IVideoDriver* driver, Client *client);
 };
index 05ae91f064023f4aa1b8a3aa4c5c930b14b789bd..f0fb09fadf280467609be6321fdcc369295db6ea 100644 (file)
@@ -608,7 +608,7 @@ void Client::handleCommand_MovePlayer(NetworkPacket* pkt)
 
        *pkt >> pos >> pitch >> yaw;
 
-       player->setPosition(pos);
+       player->setLegitPosition(pos);
 
        infostream << "Client got TOCLIENT_MOVE_PLAYER"
                        << " pos=(" << pos.X << "," << pos.Y << "," << pos.Z << ")"
@@ -622,6 +622,10 @@ void Client::handleCommand_MovePlayer(NetworkPacket* pkt)
                it would just force the pitch and yaw values to whatever
                the camera points to.
        */
+       
+       if (g_settings->getBool("no_force_rotate"))
+               return;
+       
        ClientEvent *event = new ClientEvent();
        event->type = CE_PLAYER_FORCE_MOVE;
        event->player_force_move.pitch = pitch;