patrickdenglerhobbisoft / WorldDefense

World Defense Bugs
0 stars 0 forks source link

adding towers being damaged effect #191

Open patrickdenglerhobbisoft opened 8 years ago

patrickdenglerhobbisoft commented 8 years ago

// HELMUT I NEVER ARRIVE HERE

I should hit this line of code I'm sure; it's in the SoundContentObject. I'm thinking the way I am doing it is very expensive, but I am surprised that I never see a tower

these lines: if (contactConstraint.BodyA.GetType() == typeof(RigidBody)) { TowerContentObject tower; MonsterContentObject monster; string f = (contactConstraint.BodyA as RigidBody).Name; string g = (contactConstraint.BodyB as RigidBody).Name;

                System.Diagnostics.Debug.WriteLine(g + ":" + f);
                if ( (f.ToUpper().Contains("FLOOR") || (g.ToUpper().Contains("FLOOR"))))
                     return;

always yield:

Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10 Floor:TOWERGameObject10

Helikin commented 8 years ago

Fixed it:

if ( (f.ToUpper().Contains("FLOOR") || (g.ToUpper().Contains("FLOOR")))) return; // <----- This needs to be "continue"