Skip to content

Commit 56d8c48

Browse files
authored
Merge pull request #6712 from Goober5000/a_few_fixes
A few fixes
2 parents 1f7903f + e0c4c30 commit 56d8c48

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

code/parse/parselo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2430,7 +2430,7 @@ void read_raw_file_text(const char *filename, int mode, char *raw_text)
24302430

24312431
// Compare filename by lowercase string
24322432
SCP_string key = filename;
2433-
std::transform(key.begin(), key.end(), key.begin(), ::tolower);
2433+
SCP_tolower(key);
24342434

24352435
// Check for a hash
24362436
auto it = retail_hashes.find(key);

code/scripting/api/objs/comm_order.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ADE_FUNC(selectItem, l_Comm_Item, nullptr, "Selects the item and either proceeds
6060
if (!ade_get_args(L, "o", l_Comm_Item.Get(&current)))
6161
return ADE_RETURN_FALSE;
6262

63-
if (current < 0 || current > Num_menu_items) {
63+
if (current < 0 || current >= Num_menu_items) {
6464
LuaError(L, "Lua tried to select squad message that is not valid!");
6565
return ADE_RETURN_FALSE;
6666
}

code/scripting/api/objs/ship.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ ADE_VIRTVAR(TargetSubsystem, l_Ship, "subsystem", "Target subsystem of ship.", "
811811
}
812812
}
813813

814-
return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(&Objects[aip->target_objnum], aip->targeted_subsys)));
814+
return ade_set_args(L, "o", l_Subsystem.Set(ship_subsys_h(aip->target_objnum >= 0 ? &Objects[aip->target_objnum] : nullptr, aip->targeted_subsys)));
815815
}
816816

817817
ADE_VIRTVAR(Team, l_Ship, "team", "Ship's team", "team", "Ship team, or invalid team handle if ship handle is invalid")

code/ship/ship.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,7 @@ particle::ParticleEffectHandle create_ship_legacy_particle_effect(LegacyShipPart
25572557
}
25582558

25592559
if (velocity_curve) {
2560-
effect.m_modular_curves.add_curve("Trigger Velocity", particle::ParticleEffect::ParticleCurvesOutput::VOLUME_VELOCITY_MULT, *radius_curve);
2560+
effect.m_modular_curves.add_curve("Trigger Velocity", particle::ParticleEffect::ParticleCurvesOutput::VOLUME_VELOCITY_MULT, *velocity_curve);
25612561
}
25622562

25632563
return particle::ParticleManager::get()->addEffect(std::move(effect));

0 commit comments

Comments
 (0)