@@ -821,8 +821,6 @@ bool Game_Interpreter::ExecuteCommand(lcf::rpg::EventCommand const& com) {
821
821
return CommandManiacSetGameOption (com);
822
822
case Cmd::Maniac_CallCommand:
823
823
return CommandManiacCallCommand (com);
824
- case static_cast <Game_Interpreter::Cmd>(2054 ): // Cmd::EasyRpg_GetTime
825
- return CommandGetTime (com);
826
824
default :
827
825
return true ;
828
826
}
@@ -1074,6 +1072,33 @@ bool Game_Interpreter::CommandControlSwitches(lcf::rpg::EventCommand const& com)
1074
1072
}
1075
1073
1076
1074
bool Game_Interpreter::CommandControlVariables (lcf::rpg::EventCommand const & com) { // code 10220
1075
+
1076
+ if (!com.string .empty ()){
1077
+ std::string periodName = Utils::LowerCase (ToString (com.string ));
1078
+ int32_t outputVariable = ValueOrVariable (com.parameters [0 ], com.parameters [1 ]);
1079
+
1080
+ std::time_t t = std::time (nullptr );
1081
+ std::tm * tm = std::localtime (&t);
1082
+
1083
+ int32_t dateOutput{};
1084
+
1085
+ if (periodName == " getyear" ) dateOutput = tm ->tm_year + 1900 ;
1086
+ if (periodName == " getmonth" ) dateOutput = tm ->tm_mon + 1 ;
1087
+ if (periodName == " getday" ) dateOutput = tm ->tm_mday ;
1088
+ if (periodName == " gethour" ) dateOutput = tm ->tm_hour ;
1089
+ if (periodName == " getminute" ) dateOutput = tm ->tm_min ;
1090
+ if (periodName == " getsecond" ) dateOutput = tm ->tm_sec ;
1091
+ if (periodName == " getweekday" ) dateOutput = tm ->tm_wday + 1 ;
1092
+ if (periodName == " getyearday" ) dateOutput = tm ->tm_yday + 1 ;
1093
+ if (periodName == " getdaylightsavings" ) dateOutput = tm ->tm_isdst + 1 ;
1094
+ if (periodName == " gettimestamp" ) dateOutput = t;
1095
+
1096
+ Main_Data::game_variables->Set (outputVariable, dateOutput);
1097
+ Game_Map::SetNeedRefresh (true );
1098
+
1099
+ return true ;
1100
+ }
1101
+
1077
1102
int value = 0 ;
1078
1103
int operand = com.parameters [4 ];
1079
1104
@@ -4645,32 +4670,6 @@ bool Game_Interpreter::CommandManiacCallCommand(lcf::rpg::EventCommand const&) {
4645
4670
return true ;
4646
4671
}
4647
4672
4648
- bool Game_Interpreter::CommandGetTime (lcf::rpg::EventCommand const & com) {
4649
-
4650
- std::string periodName = Utils::LowerCase (ToString (com.string ));
4651
- int32_t outputVariable = ValueOrVariable (com.parameters [0 ], com.parameters [1 ]);
4652
-
4653
- std::time_t t = std::time (nullptr );
4654
- std::tm * tm = std::localtime (&t);
4655
-
4656
- int32_t dateOutput{};
4657
-
4658
- if (periodName == " getyear" ) dateOutput = tm ->tm_year + 1900 ;
4659
- if (periodName == " getmonth" ) dateOutput = tm ->tm_mon + 1 ;
4660
- if (periodName == " getday" ) dateOutput = tm ->tm_mday ;
4661
- if (periodName == " gethour" ) dateOutput = tm ->tm_hour ;
4662
- if (periodName == " getminute" ) dateOutput = tm ->tm_min ;
4663
- if (periodName == " getsecond" ) dateOutput = tm ->tm_sec ;
4664
- if (periodName == " getweekday" ) dateOutput = tm ->tm_wday +1 ;
4665
- if (periodName == " getyearday" ) dateOutput = tm ->tm_yday +1 ;
4666
- if (periodName == " gettimestamp" ) dateOutput = t;
4667
-
4668
- Main_Data::game_variables->Set (outputVariable, dateOutput);
4669
- Game_Map::SetNeedRefresh (true );
4670
-
4671
- return true ;
4672
- }
4673
-
4674
4673
Game_Interpreter& Game_Interpreter::GetForegroundInterpreter () {
4675
4674
return Game_Battle::IsBattleRunning ()
4676
4675
? Game_Battle::GetInterpreter ()
0 commit comments