-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix some crashes 2025-01-13 #987
Changes from 44 commits
b2de538
0132b05
61c58b2
1ab4736
21440fd
b1d4927
8988b4c
fd09cd8
af66299
34cb8e1
7604ba3
c4a2fdc
0933770
8d9132d
8edfc65
2af613f
b7e9964
afce86c
30a7f68
82b09eb
3781301
4cd3f7d
6e4decc
4c99f0e
7a92f2a
481a838
ce9c51f
df25d52
6dcf929
d597c12
09f516c
36c49d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* damageable.cpp | ||
* | ||
* Copyright (C) 2020-2022 Daniel Horn, Roy Falk, Stephen G. Tuggy and | ||
* Copyright (C) 2020-2025 Daniel Horn, Roy Falk, Stephen G. Tuggy and | ||
* other Vega Strike contributors | ||
* | ||
* https://github.com/vegastrike/Vega-Strike-Engine-Source | ||
|
@@ -15,11 +15,11 @@ | |
* | ||
* Vega Strike is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>. | ||
* along with Vega Strike. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
|
@@ -524,7 +524,7 @@ float Damageable::RShieldData() const { | |
void Damageable::ArmorData(float armor[8]) const { | ||
Damageable *damageable = const_cast<Damageable *>(this); | ||
DamageableLayer armor_layer = damageable->GetArmorLayer(); | ||
for (int i = 0; i < 8; i++) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. You caught a bug of mine here. Did this segfault or fill the array with junk? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if I actually hit this section of code during my testing. If I had, though, I think a segfault would have been most likely. The destination array was too small to write 8 elements to. |
||
for (int i = 0; i < armor_layer.number_of_facets; ++i) { | ||
armor[i] = armor_layer.facets[i].health; | ||
} | ||
} | ||
|
@@ -612,5 +612,3 @@ bool Damageable::flickerDamage() { | |
} | ||
return false; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why this condition is happening. We will probably want to investigate further. But for now, this keeps the game from crashing at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this raises a bigger philosophical question of how much crap are we willing to let the engine take from the assets?
For JSON files, the file obviously needs to be formatted correctly or parsing will fail. Most JSON files are crucial to the game, so may as well crash it with an error.
But this is inside content and for a specific control so it points to an error in how I converted fonts to controls. Best open an issue/bug for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed as vegastrike/Assets-Masters#56