View Issue Details

IDProjectCategoryView StatusLast Update
0002099FSSCPgameplaypublic2010-05-12 19:38
ReporterChronoReverse Assigned ToSushi_CW  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.11 
Summary0002099: Energy transfer from shields to lasers does not reduce shields when using CustomAI
DescriptionWhen the custom AI mod or BP:WiH (which has custom AI) is loaded, transferring energy directly from shields to lasers (NOT ETS) will recharge the lasers but does not use up shield energy.

This means you can set the laser recharge to zero and keep it filled by transferring the unlimited energy from shields.
Additional InformationSteps to reproduce:
Load mod with custom AI
Start mission and set engine recharge to maximum
Fire primaries to drain capacitor
Shunt energy from shields to lasers (default key is shift+scroll-lock)

Required files:
CustomAI (http://www.hard-light.net/forums/index.php?topic=66477.0)
TagsNo tags attached.

Activities

Sushi_CW

2010-05-10 16:18

developer   ~0011954

After some digging, it turns out that the culprit is the $SMART SHIELD MANAGEMENT flag. Something about it isn't working quite right, and is causing the shields to not decrease when energy is transferred from them. Odds are, it affects the AI too.

2010-05-10 16:36

 

2099_1.patch (665 bytes)   
Index: code/object/objectshield.cpp
===================================================================
--- code/object/objectshield.cpp	(revision 6095)
+++ code/object/objectshield.cpp	(working copy)
@@ -49,7 +49,9 @@
 	if (delta == 0.0f)
 		return;
 
-	if (!(Ai_info[Ships[objp->instance].ai_index].ai_profile_flags & AIPF_SMART_SHIELD_MANAGEMENT))
+	
+	if (!(Ai_info[Ships[objp->instance].ai_index].ai_profile_flags & AIPF_SMART_SHIELD_MANAGEMENT)
+		|| delta <= 0.0f) //SUSHI: We don't want smart shield management for negative delta
 	{
 		for (int i = 0; i < MAX_SHIELD_SECTIONS; i++)
 			shield_add_quad(objp, i, delta / MAX_SHIELD_SECTIONS);
2099_1.patch (665 bytes)   

Sushi_CW

2010-05-10 16:37

developer   ~0011955

Uploaded 2099_1.patch, which fixes the bug. I suspect it also affects the AI at some point, but I'm not entirely sure what that effect is. I want to get a bit of testing done on this before committing to trunk, just so we know exactly what this affects.

Sushi_CW

2010-05-12 19:38

developer   ~0011958

Fixed in Trunk 6097.

Issue History

Date Modified Username Field Change
2010-01-23 08:44 ChronoReverse New Issue
2010-01-23 17:55 Sushi_CW Status new => assigned
2010-01-23 17:55 Sushi_CW Assigned To => Sushi_CW
2010-05-10 16:18 Sushi_CW Note Added: 0011954
2010-05-10 16:36 Sushi_CW File Added: 2099_1.patch
2010-05-10 16:37 Sushi_CW Note Added: 0011955
2010-05-12 19:38 Sushi_CW Note Added: 0011958
2010-05-12 19:38 Sushi_CW Status assigned => resolved
2010-05-12 19:38 Sushi_CW Resolution open => fixed