cc: do not stop a building fire randomly just after it started

This commit is contained in:
Crypto City 2021-11-26 19:39:58 +00:00
parent 8a12d350a8
commit b7cbde7ee3
2 changed files with 7 additions and 1 deletions

View File

@ -679,7 +679,12 @@ static void add_cities(const BlockchainDB &db, uint8_t version, cc_command_game_
{
FlagState &flag = *on_fire[i];
uint32_t p = fire_rand_state.get() % 100;
if (p < 3 * fire_duration || flag.fire_state >= 100)
bool stop;
if (version >= HF_TF_3)
stop = (flag.fire_state > 8 && p < 3 * fire_duration) || flag.fire_state >= 100;
else
stop = p < 3 * fire_duration || flag.fire_state >= 100;
if (stop)
{
events.add(cg, flag.owner, flag.id) << "Fire stopped after burning for " << (unsigned)flag.fire_state << " ticks";
cg.cities.back().fire.push_back({flag.id, 128});

View File

@ -188,6 +188,7 @@
#define HF_TF_1 15
#define HF_TF_2 16
#define HF_TF_3 17
#define PER_KB_FEE_QUANTIZATION_DECIMALS 8