openmw-tes3coop/apps/openmw/mwmp/processors/player/ProcessorGameTime.hpp

42 lines
960 B
C++
Raw Normal View History

2017-04-16 07:00:25 +00:00
//
// Created by koncord on 16.04.17.
//
#ifndef OPENMW_PROCESSORGAMETIME_HPP
#define OPENMW_PROCESSORGAMETIME_HPP
2017-05-07 18:45:44 +00:00
#include <apps/openmw/mwbase/world.hpp>
#include <apps/openmw/mwbase/environment.hpp>
2017-06-06 16:06:10 +00:00
#include "../PlayerProcessor.hpp"
2017-04-16 07:00:25 +00:00
namespace mwmp
{
class ProcessorGameTime : public PlayerProcessor
{
public:
ProcessorGameTime()
{
2017-05-07 18:45:44 +00:00
BPP_INIT(ID_GAME_TIME)
2017-04-16 07:00:25 +00:00
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isLocal())
{
MWBase::World *world = MWBase::Environment::get().getWorld();
if (player->hour != -1)
world->setHour(player->hour);
else if (player->day != -1)
world->setDay(player->day);
else if (player->month != -1)
world->setMonth(player->month);
}
}
};
}
#endif //OPENMW_PROCESSORGAMETIME_HPP