forked from townforge/townforge
game: reset queued commands list when changing wallets
This commit is contained in:
parent
af1558329d
commit
36f93c0c9d
@ -5199,6 +5199,7 @@ void CryptoCityUrho3D::HandleNewWallet(StringHash eventType, VariantMap& eventDa
|
||||
gameState.update(wallet, snapshot ? snapshot->height : 0, snapshot ? snapshot->top_hash : "");
|
||||
RebuildMap();
|
||||
|
||||
ui->ClearQueuedCommands();
|
||||
gameState.on_new_wallet(wallet);
|
||||
|
||||
std::string s;
|
||||
|
@ -729,6 +729,19 @@ void UIUrho3D::RemoveQueuedCommand(const std::string &txid)
|
||||
queuedCommandsDialog->RemoveCancelledNonce(txid);
|
||||
}
|
||||
|
||||
void UIUrho3D::ClearQueuedCommands()
|
||||
{
|
||||
for (const auto &e: queued_commands)
|
||||
{
|
||||
if (tradeDialog)
|
||||
tradeDialog->RemoveCancelledNonce(e.first);
|
||||
if (queuedCommandsDialog)
|
||||
queuedCommandsDialog->RemoveCancelledNonce(e.first);
|
||||
}
|
||||
queued_commands.clear();
|
||||
queued_commands_except_unmatched_trades.clear();
|
||||
}
|
||||
|
||||
void UIUrho3D::UpdateMining(const std::shared_ptr<GameWallet> &w)
|
||||
{
|
||||
uint32_t sync_percent = 0, mining_hash_rate = 0;
|
||||
|
@ -207,6 +207,7 @@ public:
|
||||
void ShowPlayerInfo(uint32_t player_id);
|
||||
void AddQueuedCommand(const std::string &txid, const cryptonote::cc_command_t &cmd);
|
||||
void RemoveQueuedCommand(const std::string &txid);
|
||||
void ClearQueuedCommands();
|
||||
void OnNewBlock();
|
||||
void Configure();
|
||||
void OnModelBackupAvailable();
|
||||
|
Loading…
Reference in New Issue
Block a user