Skip to content

Commit b3ef38d

Browse files
committed
rename to avoid previous confusion
1 parent b3c8348 commit b3ef38d

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

code/ai/ai.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ typedef struct ai_info {
330330
float time_enemy_near; // SUSHI: amount of time enemy continuously "near" the player
331331
fix last_attack_time; // Missiontime of last time this ship attacked its enemy.
332332
fix last_hit_time; // Missiontime of last time this ship was hit by anyone.
333-
int last_hit_quadrant; // Shield section of last hit.
333+
int danger_shield_quadrant; // Shield section AI will prefer to prioritize for recharging, it if possible.
334334
fix last_hit_target_time; // Missiontime of last time this ship successfully hit target.
335335
int hitter_objnum; // Object index of ship that hit this ship last time.
336336
int hitter_signature; // Signature of hitter. Prevents stupidity if hitter gets killed.

code/ai/aicode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13321,7 +13321,7 @@ void ai_manage_shield(object *objp, ai_info *aip)
1332113321

1332213322
if (sip->is_small_ship() || (aip->ai_profile_flags[AI::Profile_Flags::All_ships_manage_shields])) {
1332313323
if ((Missiontime - aip->last_hit_time < F1_0 * 10) && !(The_mission.ai_profile->flags[AI::Profile_Flags::AI_balances_shields_when_attacked]))
13324-
ai_transfer_shield(objp, aip->last_hit_quadrant);
13324+
ai_transfer_shield(objp, aip->danger_shield_quadrant);
1332513325
else
1332613326
ai_balance_shield(objp);
1332713327
}
@@ -15559,7 +15559,7 @@ void init_ai_object(int objnum)
1555915559
aip->time_enemy_near = 0.0f;
1556015560
aip->last_attack_time = 0;
1556115561
aip->last_hit_time = 0;
15562-
aip->last_hit_quadrant = 0;
15562+
aip->danger_shield_quadrant = 0;
1556315563
aip->hitter_objnum = -1;
1556415564
aip->hitter_signature = -1;
1556515565
aip->resume_goal_time = -1;

code/object/collideshipweapon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static int ship_weapon_check_collision(object *ship_objp, object *weapon_objp, f
450450
// so that the AI can put energy torwards repairing that shield segement (but put behind a flag)
451451
// --wookieejedi
452452
if (The_mission.ai_profile->flags[AI::Profile_Flags::Fix_AI_shield_management_bug] && SCP_vector_inbounds(ship_objp->shield_quadrant, quadrant_num)) {
453-
Ai_info[Ships[ship_objp->instance].ai_index].last_hit_quadrant = quadrant_num;
453+
Ai_info[Ships[ship_objp->instance].ai_index].danger_shield_quadrant = quadrant_num;
454454
}
455455
quadrant_num = -1;
456456
shield_collision = 0;

code/object/objectshield.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ float shield_apply_damage(object *objp, int quadrant_num, float damage)
204204

205205
if (objp->type != OBJ_SHIP && objp->type != OBJ_START)
206206
return damage;
207-
Ai_info[Ships[objp->instance].ai_index].last_hit_quadrant = quadrant_num;
207+
Ai_info[Ships[objp->instance].ai_index].danger_shield_quadrant = quadrant_num;
208208

209209
remaining_damage = damage - objp->shield_quadrant[quadrant_num];
210210
if (remaining_damage > 0.0f) {

0 commit comments

Comments
 (0)