Possible memory leak addressed
This commit is contained in:
parent
0757345e17
commit
65a3a9f678
@ -94,6 +94,8 @@ class Citizen(classes.CitizenAPI):
|
|||||||
ret = super().__dict__.copy()
|
ret = super().__dict__.copy()
|
||||||
ret.pop('reporter', None)
|
ret.pop('reporter', None)
|
||||||
ret.pop('stop_threads', None)
|
ret.pop('stop_threads', None)
|
||||||
|
ret.pop('_Citizen__last_war_update_data', None)
|
||||||
|
ret.update(all_battles=self.all_battles)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@ -440,6 +442,7 @@ class Citizen(classes.CitizenAPI):
|
|||||||
self.update_citizen_info()
|
self.update_citizen_info()
|
||||||
|
|
||||||
resp_json = self.get_military_campaigns().json()
|
resp_json = self.get_military_campaigns().json()
|
||||||
|
self.all_battles = {}
|
||||||
if resp_json.get("countries"):
|
if resp_json.get("countries"):
|
||||||
for c_id, c_data in resp_json.get("countries").items():
|
for c_id, c_data in resp_json.get("countries").items():
|
||||||
if int(c_id) not in self.countries:
|
if int(c_id) not in self.countries:
|
||||||
@ -1285,12 +1288,12 @@ class Citizen(classes.CitizenAPI):
|
|||||||
|
|
||||||
if count > 0 and not force_fight:
|
if count > 0 and not force_fight:
|
||||||
if self.my_companies.ff_lockdown and self.details.pp > 75:
|
if self.my_companies.ff_lockdown and self.details.pp > 75:
|
||||||
if self.energy.food_fights - self.my_companies.ff_lockdown > 0:
|
if count - self.my_companies.ff_lockdown > 0:
|
||||||
log_msg = ("Fight count modified (old count: {} | FF: {} | "
|
log_msg = ("Fight count modified (old count: {} | FF: {} | "
|
||||||
"WAM ff_lockdown: {} | New count: {})").format(
|
"WAM ff_lockdown: {} | New count: {})").format(
|
||||||
count, self.energy.food_fights, self.my_companies.ff_lockdown,
|
count, self.energy.food_fights, self.my_companies.ff_lockdown,
|
||||||
self.energy.food_fights - self.my_companies.ff_lockdown)
|
count - self.my_companies.ff_lockdown)
|
||||||
count = self.energy.food_fights - self.my_companies.ff_lockdown
|
count -= self.my_companies.ff_lockdown
|
||||||
else:
|
else:
|
||||||
count = 0
|
count = 0
|
||||||
if count <= 0:
|
if count <= 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user