bvschaik / julius

An open source re-implementation of Caesar III
GNU Affero General Public License v3.0
2.79k stars 311 forks source link

Small coding issue #685

Closed crudelios closed 1 year ago

crudelios commented 1 year ago

https://github.com/bvschaik/julius/blob/7c9435c90312313f47267dcee357dac46d2e7b82/src/building/granary.c#L206

@bvschaik, I think @feiyunw is correct. This code doesn't make much sense.

I take it should check how many granaries are "non-getting", but total_non_getting is counting the resources instead of granaries.

And the comparison should indeed be against 0.

Unless I'm missing something...

bvschaik commented 1 year ago

I thing it was a search-replace of 100 to the constant that should not have happened in this case. The comparison with 100 comes straight out of C3, as far as I know.

crudelios commented 1 year ago

It makes sense. It should probably be ONE_LOAD instead of MAX_GRANARIES.