mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
various bugfixes from testing
This commit is contained in:
parent
85ce3b5507
commit
26ed1cb820
10 changed files with 44 additions and 14 deletions
|
|
@ -111,7 +111,9 @@ class InstanceManager {
|
|||
var renderFrustum = scene.camera.frustum;
|
||||
var doFrustumCheck = true;
|
||||
// This sucks holy shit
|
||||
doFrustumCheck = MarbleGame.instance.world != null && MarbleGame.instance.world.marble.cubemapRenderer != null;
|
||||
doFrustumCheck = MarbleGame.instance.world != null
|
||||
&& MarbleGame.instance.world.marble.cubemapRenderer != null
|
||||
&& @:privateAccess !MarbleGame.instance.world.marble.camera.spectate;
|
||||
var cameraFrustrums = doFrustumCheck ? MarbleGame.instance.world.marble.cubemapRenderer.getCameraFrustums() : null;
|
||||
|
||||
for (meshes in objects) {
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ class Marble extends GameObject {
|
|||
this.lastRenderPos = new Vector();
|
||||
this.netSmoothOffset = new Vector();
|
||||
this.netCorrected = false;
|
||||
this.currentUp = new Vector(0, 0, 1);
|
||||
|
||||
var marbleDts = new DtsObject();
|
||||
var marbleShader = "";
|
||||
|
|
@ -772,8 +773,6 @@ class Marble extends GameObject {
|
|||
}
|
||||
|
||||
function computeMoveForces(m:Move, aControl:Vector, desiredOmega:Vector) {
|
||||
if (this.currentUp == null)
|
||||
this.currentUp = new Vector(0, 0, 1);
|
||||
var currentGravityDir = this.currentUp.multiply(-1);
|
||||
var R = currentGravityDir.multiply(-this._radius);
|
||||
var rollVelocity = this.omega.cross(R);
|
||||
|
|
@ -1971,7 +1970,8 @@ class Marble extends GameObject {
|
|||
this.shockAbsorberUseTick = p.shockAbsorberTick;
|
||||
this.serverUsePowerup = p.netFlags & MarbleNetFlags.UsePowerup > 0;
|
||||
// this.currentUp = p.gravityDirection;
|
||||
this.level.setUp(cast this, p.gravityDirection, this.level.timeState);
|
||||
if (p.gravityDirection != null)
|
||||
this.level.setUp(cast this, p.gravityDirection, this.level.timeState);
|
||||
if (this.outOfBounds && !p.oob && this.controllable)
|
||||
@:privateAccess this.level.playGui.setCenterText('');
|
||||
this.outOfBounds = p.oob;
|
||||
|
|
@ -1993,6 +1993,14 @@ class Marble extends GameObject {
|
|||
@:privateAccess level.trapdoorPredictions.acknowledgeTrapdoorUpdate(tId, tTime);
|
||||
}
|
||||
}
|
||||
if (p.netFlags & MarbleNetFlags.DoBlast > 0 && blastUseTick != 0 && !this.controllable) {
|
||||
var ublast = p.netFlags & MarbleNetFlags.DoUltraBlast > 0;
|
||||
this.level.particleManager.createEmitter(ublast ? blastMaxParticleOptions : blastParticleOptions, ublast ? blastMaxEmitterData : blastEmitterData,
|
||||
this.getAbsPos().getPosition(), () -> {
|
||||
this.getAbsPos().getPosition().add(this.currentUp.multiply(-this._radius * 0.4));
|
||||
},
|
||||
new Vector(1, 1, 1).add(new Vector(Math.abs(this.currentUp.x), Math.abs(this.currentUp.y), Math.abs(this.currentUp.z)).multiply(-0.8)));
|
||||
}
|
||||
// if (Net.isClient && !this.controllable && (this.serverTicks - this.blastUseTick) < 12) {
|
||||
// var ticksSince = (this.serverTicks - this.blastUseTick);
|
||||
// if (ticksSince >= 0) {
|
||||
|
|
@ -2424,6 +2432,12 @@ class Marble extends GameObject {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (Net.isHost) {
|
||||
this.blastUseTick = timeState.ticks;
|
||||
this.netFlags |= MarbleNetFlags.DoBlast;
|
||||
if (blastAmt > 1)
|
||||
this.netFlags |= MarbleNetFlags.DoUltraBlast;
|
||||
}
|
||||
} else {
|
||||
if (this.blastAmount < 0.2 || this.level.game != "ultra")
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package src;
|
||||
|
||||
import gui.JoinServerGui;
|
||||
import gui.MPPreGameDlg;
|
||||
import gui.MPExitGameDlg;
|
||||
import gui.GuiControl;
|
||||
|
|
@ -253,6 +254,7 @@ class MarbleGame {
|
|||
quitMission(Net.isClient);
|
||||
if (Net.isMP && Net.isClient) {
|
||||
Net.disconnect();
|
||||
canvas.setContent(new JoinServerGui());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -786,11 +786,10 @@ class MarbleWorld extends Scheduler {
|
|||
for (interior in this.interiors)
|
||||
interior.reset();
|
||||
|
||||
this.setUp(this.marble, startquat.up, this.timeState, true);
|
||||
this.deselectPowerUp(this.marble);
|
||||
this.orientationChangeTime = -1e8;
|
||||
this.oldOrientationQuat = new Quat();
|
||||
this.newOrientationQuat = new Quat();
|
||||
this.orientationChangeTime = -1e8;
|
||||
this.setUp(this.marble, startquat.up, this.timeState, true);
|
||||
this.deselectPowerUp(this.marble);
|
||||
|
||||
AudioManager.playSound(ResourceLoader.getResource('data/sound/spawn.wav', ResourceLoader.getAudio, this.soundResources));
|
||||
|
|
|
|||
|
|
@ -263,6 +263,8 @@ class Mission {
|
|||
alarmStart = 15;
|
||||
if (this.missionInfo.alarmstarttime != null)
|
||||
alarmStart = MisParser.parseNumber(this.missionInfo.alarmstarttime);
|
||||
if (alarmStart == 0)
|
||||
alarmStart = 15;
|
||||
return alarmStart;
|
||||
}
|
||||
alarmStart = 0;
|
||||
|
|
|
|||
|
|
@ -221,11 +221,11 @@ class JoinServerGui extends GuiImage {
|
|||
var joinFunc = (password:String) -> {
|
||||
if (curSelection != -1) {
|
||||
var selectedServerVersion = ourServerList[curSelection].version;
|
||||
// if (selectedServerVersion != MarbleGame.currentVersion) {
|
||||
// var pup = new MessageBoxOkDlg("You are using a different version of the game than the server. Please update your game.");
|
||||
// MarbleGame.canvas.pushDialog(pup);
|
||||
// return;
|
||||
// }
|
||||
if (selectedServerVersion != MarbleGame.currentVersion) {
|
||||
var pup = new MessageBoxOkDlg("You are using a different version of the game than the server. Please update your game.");
|
||||
MarbleGame.canvas.pushDialog(pup);
|
||||
return;
|
||||
}
|
||||
|
||||
MarbleGame.canvas.setContent(new MPMessageGui("Please Wait", "Connecting"));
|
||||
var failed = true;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class ExplodablePredictionStore {
|
|||
predictions[packet.explodableId] = packet.serverTicks;
|
||||
if (!world.explodablesToTick.contains(packet.explodableId))
|
||||
world.explodablesToTick.push(packet.explodableId);
|
||||
world.explodables[packet.explodableId].playExplosionSound();
|
||||
}
|
||||
|
||||
public inline function reset() {
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ class MasterServerClient {
|
|||
password: serverInfo.password,
|
||||
state: serverInfo.state,
|
||||
platform: serverInfo.platform,
|
||||
version: "MBP" // MarbleGame.currentVersion
|
||||
version: MarbleGame.currentVersion
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ enum abstract MarbleNetFlags(Int) from Int to Int {
|
|||
var GravityChange = 1 << 6;
|
||||
var UsePowerup = 1 << 7;
|
||||
var UpdateTrapdoor = 1 << 8;
|
||||
var DoUltraBlast = 1 << 9;
|
||||
}
|
||||
|
||||
@:publicFields
|
||||
|
|
@ -95,6 +96,7 @@ class MarbleUpdatePacket implements NetPacket {
|
|||
b.writeInt(blastAmount, 11);
|
||||
if (netFlags & MarbleNetFlags.DoBlast > 0) {
|
||||
b.writeFlag(true);
|
||||
b.writeFlag(netFlags & MarbleNetFlags.DoUltraBlast > 0);
|
||||
b.writeUInt16(blastTick);
|
||||
} else {
|
||||
b.writeFlag(false);
|
||||
|
|
@ -173,6 +175,9 @@ class MarbleUpdatePacket implements NetPacket {
|
|||
blastAmount = b.readInt(11);
|
||||
this.netFlags = 0;
|
||||
if (b.readFlag()) {
|
||||
if (b.readFlag()) {
|
||||
this.netFlags |= MarbleNetFlags.DoUltraBlast;
|
||||
}
|
||||
blastTick = b.readUInt16();
|
||||
this.netFlags |= MarbleNetFlags.DoBlast;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,11 @@ abstract class Explodable extends DtsObject {
|
|||
});
|
||||
}
|
||||
|
||||
public inline function playExplosionSound() {
|
||||
if (!this.level.rewinding && !Net.isClient)
|
||||
AudioManager.playSound(ResourceLoader.getResource(explodeSoundFile, ResourceLoader.getAudio, this.soundResources));
|
||||
}
|
||||
|
||||
override function onMarbleContact(marble:src.Marble, timeState:TimeState, ?contact:CollisionInfo) {
|
||||
if (this.isCollideable && !this.level.rewinding) {
|
||||
// marble.velocity = marble.velocity.add(vec);
|
||||
|
|
@ -90,7 +95,7 @@ abstract class Explodable extends DtsObject {
|
|||
}
|
||||
this.setCollisionEnabled(false);
|
||||
|
||||
if (!this.level.rewinding && @:privateAccess !marble.isNetUpdate)
|
||||
if (!this.level.rewinding && @:privateAccess !marble.isNetUpdate && !Net.isClient)
|
||||
AudioManager.playSound(ResourceLoader.getResource(explodeSoundFile, ResourceLoader.getAudio, this.soundResources));
|
||||
if (@:privateAccess !marble.isNetUpdate) {
|
||||
emitter1 = this.level.particleManager.createEmitter(particle, particleData, this.getAbsPos().getPosition());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue