openmw-tes3coop/apps/openmw-mp/Script/Functions/World.cpp

47 lines
1.1 KiB
C++
Raw Normal View History

2016-08-30 05:24:31 +00:00
//
// Created by koncord on 30.08.16.
//
#include <apps/openmw-mp/Player.hpp>
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include "World.hpp"
void WorldFunctions::setHour(unsigned short pid, double hour) noexcept
2016-08-30 05:24:31 +00:00
{
Player *player;
GET_PLAYER(pid, player,);
player->hour = hour;
player->month = -1;
player->day = -1;
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_TIME)->Send(player, false);
2016-08-30 05:24:31 +00:00
}
void WorldFunctions::setMonth(unsigned short pid, int month) noexcept
2016-08-30 05:24:31 +00:00
{
Player *player;
GET_PLAYER(pid, player,);
player->hour = -1;
player->month = month;
player->day = -1;
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_TIME)->Send(player, false);
2016-08-30 05:24:31 +00:00
}
void WorldFunctions::setDay(unsigned short pid, int day) noexcept
2016-08-30 05:24:31 +00:00
{
Player *player;
GET_PLAYER(pid, player,);
player->hour = -1;
player->month = -1;
player->day = day;
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_TIME)->Send(player, false);
2016-08-30 05:24:31 +00:00
}