Fix apm and average apm display

This commit is contained in:
dP
2025-06-30 00:32:52 +05:00
parent b2737fe293
commit d75253d491
9 changed files with 26 additions and 10 deletions

View File

@@ -24,7 +24,9 @@ extern uint32 _frame_counter;
struct CommandPacket;
namespace citymania {
extern CommandCost _command_execute_cost;
extern bool _automatic_command;
void ExecuteCurrentCallback(const CommandCost &cost);
void CountEffectiveAction();
}
/**
@@ -314,6 +316,7 @@ protected:
Tret res = Execute(err_message, reinterpret_cast<CommandCallback *>(callback), my_cmd, estimate_only, network_command, tile, args);
InternalPostResult(ExtractCommandCost(res), tile, estimate_only, only_sending, err_message, my_cmd);
citymania::_command_execute_cost = ExtractCommandCost(res);
if (!estimate_only && !only_sending && !citymania::_automatic_command && my_cmd) citymania::CountEffectiveAction();
if (!estimate_only && !only_sending && callback != nullptr) {
if constexpr (std::is_same_v<Tcallback, CommandCallback>) {