This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR is like a warm bath after all day in the cold... ;)
However, I would have a few comments that might be worth considering. I'm writing this having in mind possible improvements to this function, including PR or in the future separately.
There is a real risk of using objects to block other players in online games. Therefore, such a possibility should be an option or there should be a setting to limit the construction area - JGR has the following settings:
build_object_per_64k_frames = 2097152
build_object_frame_burst = 2048
If this PR is also adding them, that should be enough.
Is it possible to limit the stretching of the construction mesh so that the area is not larger than in the build_object_frame_burst setting? It is a bit strange when you can stretch a construction field without limit, and finally there will be, for example, 1 object on it.
example with build_object_frame_burst = 1
It will be much easier to reserve an area with objects than by purchasing it. Could this change also apply to the purchase of land? It seems to me that there is no need to separate it - both are de facto objects.
This change will allow area-based construction of all 1x1 size objects, but many of these should not necessarily be able to do so. Perhaps the creators should be able to add markings that will prevent such construction of selected objects.
This PR includes such settings, as well as the global on/off switch (in Settings, chosen by the server owner for all players) for building multiple objects at once. 😄
If a server wants to limit building more than one object, they should turn the feature off completely rather than limiting it with the burst limit.
JGRPP also includes this feature, but it is a separate command code-wise and I think would be a separate PR.
I don't see a problem with the player doing what they want, besides it looking silly. Forcibly limiting certain objects to a size chosen by the NewGRF author would require an addition to the NewGRF spec, and would be Too Much Work For Too Little Benefit, in my opinion.
It works! One final issue: when I try to build an extremely large area of objects, which I could afford if it weren't too large an area to be allowed, I get an assertion error: res_test.GetCost() == res_exec.GetCost() && res_test.Failed() == res_exec.Failed()
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.