Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix wrong null check #43

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public Character SpawnCharacter(GameWorld world, PlayerState owner, Vector3 posi
{
var heroTypeRegistry = resourceSystem.GetResourceRegistry<HeroTypeRegistry>();

heroIndex = Mathf.Min(heroIndex, heroTypeRegistry.entries.Count);
heroIndex = Mathf.Min(heroIndex, heroTypeRegistry.entries.Count-1);
var heroTypeAsset = heroTypeRegistry.entries[heroIndex];

var charPrefabGUID = m_settings.characterPrefab.guid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ protected override void Initialize(ref ComponentGroup group)
var hitCollHistoryEntity = hitCollHistory.gameObject.GetComponent<GameObjectEntity>().Entity;
var externalSetup = hitCollHistory.settings.collisionSetup != null;
var colliderSetup = externalSetup ? hitCollHistory.settings.collisionSetup.transform : hitCollHistory.transform;

GameDebug.Assert(hitCollHistory.hitCollisionOwner != Entity.Null,"HitCollisionHistory requires HitCollisionOwner component");

var hitCollisionOwner =
EntityManager.GetComponentObject<HitCollisionOwner>(hitCollHistory.hitCollisionOwner);

GameDebug.Assert(hitCollHistory.hitCollisionOwner != null,"HitCollisionHistory requires HitCollisionOwner component");


// Find and disable all all colliders on collisionOwner
var sourceColliders = new List<Collider>();
RecursiveGetCollidersInChildren(colliderSetup.transform, sourceColliders);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public override bool Verify()
}

var replicatedEntity = go.GetComponent<ReplicatedEntity>();
if (go == null)
if (replicatedEntity == null)
{
Debug.Log(go + " has no ReplicatedEntity component");
verified = false;
Expand Down