View Issue Details

IDProjectCategoryView StatusLast Update
0002454FSSCPgameplaypublic2011-06-11 22:45
ReporterThe_E Assigned ToThe_E  
PrioritylowSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.13 
Fixed in Version3.6.13 
Summary0002454: Weapon damage not applied correctly for AI or player
DescriptionFollowing discussion found here: http://www.hard-light.net/forums/index.php?topic=76608.0

It seems that the player and the AI operate on different rules regarding the damage they are able to do. Test mission is attached, showing the issue.
TagsNo tags attached.

Activities

2011-06-11 18:17

 

weapontest.fs2 (4,067 bytes)

2011-06-11 18:52

 

weapondamage.patch (1,530 bytes)   
Index: code/ai/ai_profiles.cpp
===================================================================
--- code/ai/ai_profiles.cpp	(revision 7237)
+++ code/ai/ai_profiles.cpp	(working copy)
@@ -428,6 +428,8 @@
 
 			set_flag(profile, "$allow beams to damage bombs:", AIPF2_BEAMS_DAMAGE_WEAPONS, AIP_FLAG2);
 
+			set_flag(profile, "$use damage scaling for ai weapons:", AIPF2_AI_WEAPON_SCALE_FIX, AIP_FLAG2);
+
 			profile->ai_path_mode = AI_PATH_MODE_NORMAL;
 			if(optional_string("$ai path mode:"))
 			{
Index: code/ai/ai_profiles.h
===================================================================
--- code/ai/ai_profiles.h	(revision 7237)
+++ code/ai/ai_profiles.h	(working copy)
@@ -60,6 +60,7 @@
 #define AIPF2_AI_AIMS_FROM_SHIP_CENTER								(1 << 6)
 #define AIPF2_ALLOW_PRIMARY_LINK_DELAY								(1 << 7)
 #define	AIPF2_BEAMS_DAMAGE_WEAPONS									(1 << 8)
+#define AIPF2_AI_WEAPON_SCALE_FIX									(1 << 9)
 
 // AI Path types
 #define	AI_PATH_MODE_NORMAL 0
Index: code/weapon/weapons.cpp
===================================================================
--- code/weapon/weapons.cpp	(revision 7237)
+++ code/weapon/weapons.cpp	(working copy)
@@ -6771,7 +6771,7 @@
 		if( is_big_damage_ship && !(wip->wi_flags & (WIF_HURTS_BIG_SHIPS)) ){
 
 			// if the player is firing it
-			if ( from_player ) {
+			if ( from_player || The_mission.ai_profile->flags2 & AIPF2_AI_WEAPON_SCALE_FIX) {
 				// if it's a laser weapon
 				if(wip->subtype == WP_LASER){
 					total_scale *= 0.01f;
weapondamage.patch (1,530 bytes)   

The_E

2011-06-11 18:52

administrator   ~0012710

Okay, after a bit of digging, this is confirmed as a retail "feature".

However, since I find this "feature" to be more of a "bug", I propose the addition of an AI Profiles flag to better control this behaviour. Patch attached.

The_E

2011-06-11 22:45

administrator   ~0012711

After discussion with Sushi, I added a new AI Profiles option in 7238

Issue History

Date Modified Username Field Change
2011-06-11 18:17 The_E New Issue
2011-06-11 18:17 The_E File Added: weapontest.fs2
2011-06-11 18:52 The_E File Added: weapondamage.patch
2011-06-11 18:52 The_E Note Added: 0012710
2011-06-11 18:52 The_E Priority high => low
2011-06-11 18:52 The_E Status new => acknowledged
2011-06-11 22:45 The_E Note Added: 0012711
2011-06-11 22:45 The_E Status acknowledged => resolved
2011-06-11 22:45 The_E Fixed in Version => 3.6.13
2011-06-11 22:45 The_E Resolution open => fixed
2011-06-11 22:45 The_E Assigned To => The_E