Skip to content

Commit

Permalink
v1.6.4.3
Browse files Browse the repository at this point in the history
* Fixed wormhole relocation in single player via Chaos Bomb
* Ensured town portal (not general wormhole) closure via Chaos Bomb (no random chance)
  • Loading branch information
hamstar committed Jul 15, 2017
1 parent d41c315 commit 3b0ca9f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 3 additions & 5 deletions Projectiles/ChaosBombProjectile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override void AI() {
if( link.DetectCollision(rect) != 0 ) {
proj.Kill();
if( rand == 0 ) {
link.ApplyChaosHit();
link.ApplyChaosHit( mymod );
return;
}
}
Expand All @@ -72,10 +72,8 @@ public override void AI() {
if( modplayer.MyPortal != null && !modplayer.MyPortal.IsClosed ) {
if( modplayer.MyPortal.DetectCollision(rect) != 0 ) {
proj.Kill();
if( rand == 0 ) {
modplayer.MyPortal.Close(); // Town portals only close; never re-randomize (for the current version)
return;
}
modplayer.MyPortal.Close(); // Town portals only close; never re-randomize (for the current version)
return;
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions Wormholes/WormholeLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,13 @@ public int DetectCollision( Rectangle rect ) {
return on_portal;
}

public void ApplyChaosHit() {
WormholesNetProtocol.SendWormholeRerollRequestViaClient( this.MyMod, this.ID );
public void ApplyChaosHit( WormholesMod mymod ) {
if( Main.netMode == 0 ) { // Single
var mngr = mymod.GetModWorld<WormholesWorld>().Wormholes;
mngr.Reroll( this );
} else { // Non-single
WormholesNetProtocol.SendWormholeRerollRequestViaClient( this.MyMod, this.ID );
}
}

////////////////
Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
author = hamstar
version = 1.6.4.2
version = 1.6.4.3
displayName = Wormholes
modReferences = HamstarHelpers
buildIgnore = *.csproj, *.user, obj\*, bin\*, .vs\*
Expand Down

0 comments on commit 3b0ca9f

Please sign in to comment.