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

Three Fixes #193

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Three Fixes #193

merged 2 commits into from
Nov 21, 2023

Conversation

Flatfingers
Copy link
Collaborator

  1. Prevent crash in Thruster.lua when any ship (player or NPC) is destroyed. A test was added recently to Thruster:render() to not display thrusters if the player's ship was in first-person mode. This test was referencing a nil object when any ship is destroyed, causing a crash to desktop. This test has been temporarily commented out until it can be refined if necessary.

  2. Prevent crash when "B" to spawn a new player ship is pressed more than one time. The recent addition to enable "B" to generate multiple Solo sized player ships before entering a game universe, and "F" to spawn the created player ship, worked only if "B" was pressed once. If "B" was pressed twice or more, then the ship was spawned, a hard crash would occur in the sensor display section of HUD.lua because the position of the newly spawned ship was too close to zero to be normalized. This has been corrected by telling Universe:CreateShip() to use the ship position generated in System:spawnShip().

  3. Not a crash, but an incredibly loud noise when first displaying a new universe. Currently setVolume isn't working, so the pulseFire variable was being set to nil to prevent the sound of pulse weapons firing from being played. This setting was changed in MusicPlayer.lua, causing the pulseFire sound to be unexpectedly played at maximum volume at universe start-up time, and to generate "command queue full" messages at high speed during play. This has been temporarily resolved by commenting out the section of code in MusicPlayer.lua that generates a non-nil value for the pulseFire variable.

1. Prevent crash in Thruster.lua when any ship (player or NPC) is destroyed. A test was added recently to Thruster:render() to not display thrusters if the player's ship was in first-person mode. This test was referencing a nil object when any ship is destroyed, causing a crash to desktop. This test has been temporarily commented out until it can be refined if necessary.

2. Prevent crash when "B" to spawn a new player ship is pressed more than one time. The recent addition to enable "B" to generate multiple Solo sized player ships before entering a game universe, and "F" to spawn the created player ship, worked only if "B" was pressed once. If "B" was pressed twice or more, then the ship was spawned, a hard crash would occur in the sensor display section of HUD.lua because the position of the newly spawned ship was too close to zero to be normalized. This has been corrected by telling Universe:CreateShip() to use the ship position generated in System:spawnShip().

3. Not a crash, but an incredibly loud noise when first displaying a new universe. Currently setVolume isn't working, so the pulseFire variable was being set to nil to prevent the sound of pulse weapons firing from being played. This setting was changed in MusicPlayer.lua, causing the pulseFire sound to be unexpectedly played at maximum volume at universe start-up time, and to generate "command queue full" messages at high speed during play. This has been temporarily resolved by commenting out the section of code in MusicPlayer.lua that generates a non-nil value for the pulseFire variable.
@Flatfingers Flatfingers added the bug Something isn't working label Nov 21, 2023
@@ -52,9 +52,10 @@ end

function Thruster:render(state)
if state.mode == BlendMode.Additive then
if self.parent:getOwner():getControlling() == GameState.player.currentShip and GameState.player.currentCamera == Enums.CameraMode.FirstPerson then
Copy link
Member

@IllustrisJack IllustrisJack Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it´s prob better to use a multiline comment so that the formatter doesn´t destroy it again ;)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually did at first, and changed it back, because my editor didn't like it. Updated now.

Switched to multiline comment style.
@Flatfingers
Copy link
Collaborator Author

Also, why am I getting an error on the automated Windows build?

@IllustrisJack
Copy link
Member

IllustrisJack commented Nov 21, 2023

Also, why am I getting an error on the automated Windows build?

You can safely ignore with the changes you did here. See https://github.com/Limit-Theory-Redux/ltheory/pull/190/files/03a57d95856bca087d1ef7c83144c15140dff9c1#diff-4f81711127e2ae1f1947a4070999a145c42e12ed8a45458c7f483de38374e9e7

Also the discussion on discord: https://discord.com/channels/695088786702336000/1001727717848391810/1176454296896819270

Haron fixes it in that PR, the build on main should succeed without issues

@Flatfingers
Copy link
Collaborator Author

Haron fixes it in that PR, the build on main should succeed without issues

I wondered if it was connected to that. Thanks!

@Flatfingers Flatfingers merged commit a81dcd3 into main Nov 21, 2023
@Flatfingers Flatfingers deleted the Flat/framework branch November 21, 2023 19:35
@@ -114,7 +114,9 @@ function Universe:CreateShip(system, pos, shipObject)
ship:setName(shipObject.shipName)

-- Insert ship into this star system
local spawnPosition = pos or Config.gen.origin
local spawnPosition = ship:getPos() -- use semi-randomly generated position from spawnShip()
Copy link
Member

@IllustrisJack IllustrisJack Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must have been pretty tired when i approved this :D - now that i think of this it´s kinda a bad fix, also generating a ship was working before, better we fix the bug u got in hud.lua instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this change now bugs out the camera in that generation screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants