This repository has been archived by the owner on Sep 3, 2022. It is now read-only.
Progress #1281 -- ObjectManager.Update, vision and spawn rewrite #1290
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.
Suggestion cannot be applied right now. Please check back later.
Changes (in no order):
autospawn
for particles.TeamHasVision
- DEPRECATED,obj.IsVisibleByTeam(team)
should be used instead.//TODO: Leave the option to force a vision update and a warning that it's not efficient?
UpdateVisibilityAndSpawnIfNecessary
toObjectManager
lock
s have been commented out as unnecessaryNavGridCell
IsVisibleByTeam
function inGameObject
, now it usesuint
and bitwise operations to store a list of teams that we can see the object with, which is more efficient.IsSpawned
andSetAsSpawned
functions have been added to theGameObject
, replacing the_visionUnits
list in theObjectManager
. In the future, they will allow to determine for clients from which teams the object has already been spawned, which will allow to spawn objects only when they first enter the visibility zone, reducing the likelihood of cheating (individual objects will spawn for everyone, for example, minions, the time and position of the appearance of which for no one secret), and also allow to solve the existing problem that if the particle was created outside the command's visibility zone, it will not be created when entering the visibility zone, as happens with attacked objects that have aNotifyEnterVisibilityClient
.*VisionUnits
- removed// TODO: send this in one place only
are commented out because syncing everything and everything is done inGameManager.Update
, but this may change in the future if a way is found to transmit only changes.ObjectManager
toObjAiBase
andSpellMissile
.NotifyTeamVisibilityChange
function has been added toPacketNotifier
, which sends the appropriate packet based on the type of the object passed to it.