Skip to content

Commit

Permalink
Fix a group of situational collision bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wareya committed Apr 3, 2013
1 parent 1118307 commit bb66c87
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 17 deletions.
16 changes: 16 additions & 0 deletions Source/gg2/Objects/InGameElements/Character.events/Begin Step.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ if(abs(hspeed)<0.195 /*and not moveStatus = 3*/) { // Overweight carrying int
animationImage=0;
}

with(IntelGate)
solid = (team != other.team and other.intel and !global.mapchanging);
with(TeamGate)
solid = ((team != other.team or other.intel) and !global.mapchanging);
with(PlayerWall)
solid = true;
with(PlayerWallHorizontal)
solid = true;

if(place_free(x,y+1)) {
vspeed += 0.6;
if(vspeed>10) {
Expand All @@ -210,6 +219,13 @@ if(place_free(x,y+1)) {
}
}

with(Gate)
solid = false;
with(PlayerWall)
solid = false;
with(PlayerWallHorizontal)
solid = false;

if (intel)
{
if (random(1) > 0.90 && speed > 0.195)
Expand Down
17 changes: 17 additions & 0 deletions Source/gg2/Objects/InGameElements/Character.events/End Step.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
<appliesTo>.self</appliesTo>
<arguments>
<argument kind="STRING">// Climbing down stairs

with(IntelGate)
solid = (team != other.team and other.intel and !global.mapchanging);
with(TeamGate)
solid = ((team != other.team or other.intel) and !global.mapchanging);
with(PlayerWall)
solid = true;
with(PlayerWallHorizontal)
solid = true;

if(vspeed == 0) // if we aren't falling this frame
{
if(place_free(x,y+6))
Expand All @@ -24,6 +34,13 @@ if(vspeed == 0) // if we aren't falling this frame
}
xprevious = x;
yprevious = y;

with(Gate)
solid = false;
with(PlayerWall)
solid = false;
with(PlayerWallHorizontal)
solid = false;

if(global.isHost &amp;&amp; hp&lt;=0) {
var assistant;
Expand Down
33 changes: 16 additions & 17 deletions Source/gg2/Objects/InGameElements/Character.events/Step.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,24 @@
<argument kind="STRING">speed = min(speed, 15);
timeUnscathed = min(timeUnscathed+1, 10*30);

with(IntelGate)
solid = (team != other.team and other.intel and !global.mapchanging);
with(TeamGate)
solid = ((team != other.team or other.intel) and !global.mapchanging);
with(PlayerWall)
solid = true;
with(PlayerWallHorizontal)
solid = true;

if (!place_free(x+hspeed, y+vspeed))
{
with(IntelGate)
solid = (team != other.team and other.intel and !global.mapchanging);
with(TeamGate)
solid = ((team != other.team or other.intel) and !global.mapchanging);
with(PlayerWall)
solid = true;
with(PlayerWallHorizontal)
solid = true;
characterHitObstacle();
with(Gate)
solid = false;
with(PlayerWall)
solid = false;
with(PlayerWallHorizontal)
solid = false;
}
colliding = false;

with(Gate)
solid = false;
with(PlayerWall)
solid = false;
with(PlayerWallHorizontal)
solid = false;

// cleanup
//x -= hspeed;
Expand Down

0 comments on commit bb66c87

Please sign in to comment.