This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/backend/commands/player/misc/enter_interior.cpp
maybegreat48 79e5e7a30b
Commands (#725)
* feat(Commands): Prototype command system
* feat(Commands): Chat commands
* refactor(Toxic): convert most options into commands
* feat(Protections): block breakup kicks on other players as host
* refactor(Kicks): convert most options into commands
* refactor(Commands): add labels and descriptions to all commands
* feat(Commands): cleanup on unload
* refactor(Troll): convert most options into commands
* refactor(Misc): convert most options into commands
* refactor(Teleport): convert most options into commands
* feat(Commands): Variadic commands and toggleable bools
* feat(Hotkeys): hotkeys now use commands
* fix(Chat): fix the chat window locking up when a message is sent
* fix(Commands): properly handle spoofed username
* fix(Spam): update filter

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
2022-12-22 21:23:32 +00:00

42 lines
1.6 KiB
C++

#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "util/misc.hpp"
namespace big
{
class enter_interior : player_command
{
using player_command::player_command;
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
if (*scr_globals::globalplayer_bd.at(player->id(), scr_globals::size::globalplayer_bd).at(318).at(6).as<int*>() == -1)
{
g_notification_service->push_error("Enter Interior", "Player does not seem to be in an interior");
return;
}
int owner = *scr_globals::globalplayer_bd.at(player->id(), scr_globals::size::globalplayer_bd).at(318).at(9).as<int*>();
if (owner == -1)
owner = player->id();
*script_global(1950108).at(3684).as<int*>() = 0;
*script_global(1950108).at(3682).as<int*>() = 1;
*script_global(1950108).at(4780).as<int*>() = 1;
*script_global(1950108).at(3218).as<int*>() = 1; // this doesnt exists at all?
*script_global(1950108).at(3214).as<int*>() = 1; // ^
*script_global(1950108).at(3689).as<int*>() = 1;
// misc::set_bit(script_global(1950108).at(1).as<int*>(), 22);
misc::set_bit(script_global(1950108).as<int*>(), 6);
misc::clear_bit(script_global(1950108).at(1).as<int*>(), 9);
*script_global(1950108).at(3346).as<int*>() = owner;
*script_global(1950108).at(3683).as<int*>() = *scr_globals::globalplayer_bd.at(player->id(), scr_globals::size::globalplayer_bd).at(318).at(6).as<int*>();
}
};
enter_interior g_enter_interior("enterint", "Enter Interior", "Enters the player's interior", 0, false);
}