mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 03:09:18 +02:00
network-aware obstacles, other changes
This commit is contained in:
@@ -130,16 +130,17 @@ void state_manager::process_commands() {
|
||||
|
||||
if (commanddata.command == user_command::queueevent) {
|
||||
uint32_t id = std::round(commanddata.param1);
|
||||
basic_event *ev = Events.FindEventById(id); // TODO: depends on vector position
|
||||
Events.AddToQuery(ev, nullptr);
|
||||
basic_event *ev = Events.FindEvent(commanddata.payload);
|
||||
if (ev)
|
||||
Events.AddToQuery(ev, nullptr);
|
||||
}
|
||||
|
||||
if (commanddata.command == user_command::setlight) {
|
||||
uint32_t id = commanddata.action;
|
||||
int light = std::round(commanddata.param1);
|
||||
float state = commanddata.param2;
|
||||
if (id < simulation::Instances.sequence().size())
|
||||
simulation::Instances.sequence()[id]->LightSet(light, state); // TODO: depends on vector position
|
||||
TAnimModel *model = simulation::Instances.find(commanddata.payload);
|
||||
if (model)
|
||||
model->LightSet(light, state);
|
||||
}
|
||||
|
||||
if (commanddata.command == user_command::setdatetime) {
|
||||
@@ -161,6 +162,21 @@ void state_manager::process_commands() {
|
||||
Global.AirTemperature = commanddata.param1;
|
||||
}
|
||||
|
||||
if (commanddata.command == user_command::insertmodel) {
|
||||
std::istringstream ss(commanddata.payload);
|
||||
|
||||
std::string name;
|
||||
std::string data;
|
||||
std::getline(ss, name, ':');
|
||||
std::getline(ss, data, ':');
|
||||
|
||||
simulation::State.create_model(data, name, commanddata.location);
|
||||
}
|
||||
|
||||
if (commanddata.command == user_command::deletemodel) {
|
||||
simulation::State.delete_model(simulation::Instances.find(commanddata.payload));
|
||||
}
|
||||
|
||||
if (DebugModeFlag) {
|
||||
if (commanddata.command == user_command::timejump) {
|
||||
Time.update(commanddata.param1);
|
||||
|
||||
Reference in New Issue
Block a user