Compare commits

...
Author SHA1 Message Date
SirKnightly 602092c67c Automated build commit 2024-04-01 15:49:37 +00:00
JohnAFernandez ed20982b32 Update Version Override 2024-03-25 23:59:39 -04:00
JohnAFernandez e21cc10c5e Update Release Mako with Previous Thread 2024-03-25 22:54:52 -04:00
Asteroth b5fe16081d fix an issue with animation directions 2024-03-25 22:54:52 -04:00
mjn-mixael 41bff809e3 Don't init the debrief ui in API mode 2024-03-25 22:54:52 -04:00
mjn-mixael f119f3d370 Default post processing to on because so many things require it 2024-03-25 22:54:52 -04:00
Joshua Glatt a90a0a55bd Handle container data correctly with eval_num() (#6031) 2024-03-25 22:54:52 -04:00
Joshua Glatt d08d8b4b02 fix crash when right-clicking on container modifier (#6030) 2024-03-25 22:54:52 -04:00
Mike Nelson f1292ad15a Push back instead of direct assignment (#6024)
* push back instead of direct assignment

* remove i
2024-03-25 22:54:51 -04:00
wookieejedi eb911c8ca2 Fix CTD with HUD Preset Switching (#6022)
* Fix CTD with HUD Preset Switching

After #5302 it was discoved that pressing the `Next` button in the HUD presets would cause a CTD.

Thanks for Lafiel for figuring this out
`If HC_current_file is HC_preset_filenames.size() - 1, then it'll oob on a vector access.`

Testing this PR fixes that crash.

* use static cast
2024-03-25 22:54:51 -04:00
MageKing17 125de7f131 Fix SSM strikes with a variable count.
In #2464, a somewhat hard-to-understand equation involving taking the modulo of a random number was replaced with a function that would do those calculations instead. The problem is that the function performed the *entire* formula, while the code it replaced was only operating on the *difference* between the two numbers. Fortunately, this is as easy to fix as changing a `+=` into just an `=`.
2024-03-25 22:54:51 -04:00
Birk Magnussen 78d0bddbe1 Add comment on MAX_OBJECTS 2024-03-25 22:54:51 -04:00
Birk Magnussen b009991fae Increase collision pair cache bitshift 2024-03-25 22:54:51 -04:00
Goober5000 f2806dc77a fix "this ship name is already in use" bug
This rather insidious FRED bug was all down to an improper check for the current ship.  It is possible for multiple objects of different types to be selected at the same time.  If, for example, a waypoint and ship are selected, and the waypoint was selected first, the waypoint will be what `cur_object_index` refers to.  Since the ship is the one and only ship selected, it will be what `single_ship` refers to.  Therefore, to avoid flagging its own ship name as a duplicate, the loop should exclude the single ship, not the current object.

The bug can be reliably triggered by selecting a waypoint, then adding a ship to the selection, then switching the focus to another application and back to FRED.  This finally squashes the bug.
2024-03-14 17:03:17 -04:00
SirKnightly 6cbf0fbbf8 Automated build commit 2024-02-26 02:47:29 +00:00
15 changed files with 30 additions and 17 deletions

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ PLACEHOLDER
Deprecations are a mechanism in FSO where a certain feature or aspect of the engine has changed or is no longer supported. Since this would normally break existing mods, we have the mod table feature "[tt]$Target Version:[/tt]" with which a mod can specify what version of FSO it was developed with. Any features listed under Deprecations will be removed or changed when the target version of a mod is at least the version released in this post.
[size=5pt]Previous [url=https://www.hard-light.net/forums/index.php?topic=99015.0]23.2.1 Release Thread[/url][/size]
[size=5pt]Previous [url=https://www.hard-light.net/forums/index.php?topic=99166.0]24.0.0 Release Thread[/url][/size]
Launchers, if you don't have one already:
[b]All platforms: [/b] For every day use, we recommend [url=https://knossosnet.github.io/Knossos-Release-Page/]Knossos.NET[/url], an integrated solution for downloading and launching mods.
+1
View File
@@ -72,6 +72,7 @@
#define MAX_POLYGON_MODELS 300
// object.h
//If this value exceeds 2^16-1, this will break collision pair caching as is. Proceed with caution.
#define MAX_OBJECTS 5000 //Increased from 3500 to 5000 in 2022
// from weapon.h (and beam.h)
+1 -1
View File
@@ -460,7 +460,7 @@ static auto PostProcessOption __UNUSED = options::OptionBuilder<bool>("Graphics.
std::pair<const char*, int>{"Controls whether post processing is enabled in the engine.", 1727})
.category("Graphics")
.level(options::ExpertLevel::Advanced)
.default_val(false)
.default_val(true)
.bind_to_once(&Gr_post_processing_enabled)
.importance(69)
.finish();
+1 -1
View File
@@ -328,7 +328,7 @@ void ssm_create(object *target, vec3d *start, size_t ssm_index, ssm_firing_info
count = Ssm_info[ssm_index].count;
if (Ssm_info[ssm_index].max_count != -1 && (Ssm_info[ssm_index].max_count - count) > 0) {
count += Random::next(count, Ssm_info[ssm_index].max_count);
count = Random::next(count, Ssm_info[ssm_index].max_count);
}
// override in multiplayer
+1 -3
View File
@@ -1323,10 +1323,8 @@ void hud_config_button_do(int n)
break;
}
if (HC_current_file >= (int)HC_preset_filenames.size()) {
if ((++HC_current_file) >= static_cast<int> (HC_preset_filenames.size())) {
HC_current_file = 0;
} else {
HC_current_file++;
}
// load em up
+3 -1
View File
@@ -1963,7 +1963,9 @@ void debrief_init(bool API_Access)
// be backed out if used chooses to replace them.
scoring_level_close();
debrief_ui_init(); // init UI items
if (!API_Access) {
debrief_ui_init(); // init UI items
}
debrief_award_init();
show_stats_init();
debrief_voice_init();
+3 -1
View File
@@ -299,13 +299,15 @@ namespace animation {
if (direction == ModelAnimationDirection::RWD) {
instanceData.state = ModelAnimationState::RUNNING;
instanceData.time -= timeOffset;
instanceData.time -= timeOffset;
instanceData.canonicalDirection = ModelAnimationDirection::RWD;
if (force)
instanceData.time = instant ? 0 : instanceData.duration - timeOffset;
}
else {
instanceData.state = ModelAnimationState::RUNNING;
instanceData.time += timeOffset;
instanceData.canonicalDirection = ModelAnimationDirection::FWD;
if (force)
instanceData.time = instant ? instanceData.duration : 0 + timeOffset;
}
+3 -1
View File
@@ -27,6 +27,8 @@ int Num_pairs_checked = 0;
SCP_vector<int> Collision_sort_list;
static_assert(1 << collision_cache_bitshift > MAX_OBJECTS, "Collision pair caching currently relies on the highest possible objnum being less than 2^collision_cache_bitshift.");
class collider_pair
{
public:
@@ -867,7 +869,7 @@ void obj_collide_pair(object *A, object *B)
}
bool valid = false;
uint key = (OBJ_INDEX(A) << 12) + OBJ_INDEX(B);
uint key = (OBJ_INDEX(A) << collision_cache_bitshift) + OBJ_INDEX(B);
collider_pair* collision_info = &Collision_cached_pairs[key];
+2
View File
@@ -43,6 +43,8 @@ struct collision_info_struct {
#define MIN_LANDING_SOUND_VEL 2.0f
#define LANDING_POS_OFFSET 0.05f
constexpr uint32_t collision_cache_bitshift = 16;
//===============================================================================
// GENERAL COLLISION DETECTION HELPER FUNCTIONS
// These are in CollideGeneral.cpp and are used by one or more of the collision-
+3 -4
View File
@@ -5216,7 +5216,8 @@ int eval_num(int n, bool &is_nan, bool &is_nan_forever)
Assert(n >= 0);
int op_n = CAR(n);
if (op_n >= 0) // if argument is a sexp
// CAR() of a container data node is the container modifier
if (op_n >= 0 && Sexp_nodes[n].subtype != SEXP_ATOM_CONTAINER_DATA) // if argument is a sexp
{
int val = eval_sexp(op_n);
@@ -16130,14 +16131,12 @@ void sexp_set_asteroid_field(int n)
SCP_vector<SCP_string> targets;
if (n >= 0) {
int i = 0;
for (; n >= 0; true ? n = CDR(n) : n = -1) {
auto ship_entry = eval_ship(n);
if (!ship_entry)
continue;
targets[i] = ship_entry->name;
i++;
targets.push_back(ship_entry->name);
}
}
+2 -1
View File
@@ -916,7 +916,8 @@ void sexp_tree::right_clicked(int mode)
// Replace Container Data submenu
// disallowed on variable-type SEXP args, to prevent FSO/FRED crashes
// also disallowed for special argument options (not supported for now)
if (op_type != OPF_VARIABLE_NAME && !is_argument_provider_op(Operators[op].value)) {
// op < 0 means we're on a container modifier, and nested Replace Container Data is allowed
if (op_type != OPF_VARIABLE_NAME && (op < 0 || !is_argument_provider_op(Operators[op].value))) {
int container_data_index = 0;
for (const auto &container : get_all_sexp_containers()) {
UINT flags = MF_STRING | MF_GRAYED;
+1 -1
View File
@@ -1085,7 +1085,7 @@ int CShipEditorDlg::update_data(int redraw)
m_ship_name.TrimRight();
ptr = GET_FIRST(&obj_used_list);
while (ptr != END_OF_LIST(&obj_used_list)) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (cur_object_index != OBJ_INDEX(ptr))) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (single_ship != ptr->instance)) {
str = Ships[ptr->instance].ship_name;
if (!stricmp(m_ship_name, str)) {
if (bypass_errors)
@@ -429,7 +429,7 @@ namespace fso {
drop_white_space(_m_ship_name);
ptr = GET_FIRST(&obj_used_list);
while (ptr != END_OF_LIST(&obj_used_list)) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (_editor->currentObject != OBJ_INDEX(ptr))) {
if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (single_ship != ptr->instance)) {
str = Ships[ptr->instance].ship_name;
if (!stricmp(_m_ship_name.c_str(), str)) {
auto button = _viewport->dialogProvider->showButtonDialog(DialogType::Error,
+2 -1
View File
@@ -5946,7 +5946,8 @@ std::unique_ptr<QMenu> sexp_tree::buildContextMenu(QTreeWidgetItem* h) {
// Replace Container Data submenu
// disallowed on variable-type SEXP args, to prevent FSO/FRED crashes
// also disallowed for special argument options (not supported for now)
if (op_type != OPF_VARIABLE_NAME && !is_argument_provider_op(Operators[op].value)) {
// op < 0 means we're on a container modifier, and nested Replace Container Data is allowed
if (op_type != OPF_VARIABLE_NAME && (op < 0 || !is_argument_provider_op(Operators[op].value))) {
const auto &containers = get_all_sexp_containers();
for (int idx = 0; idx < (int)containers.size(); ++idx) {
const auto &container = containers[idx];
+5
View File
@@ -0,0 +1,5 @@
set(FSO_VERSION_MAJOR 24)
set(FSO_VERSION_MINOR 0)
set(FSO_VERSION_BUILD 1)
set(FSO_VERSION_REVISION 0)
set(FSO_VERSION_REVISION_STR RC2)