View Issue Details

IDProjectCategoryView StatusLast Update
0002911FSSCPSEXPspublic2013-09-11 07:51
ReporterAxem Assigned Toniffiwan  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Summary0002911: activate-glowpoint-bank will always activate bank 0
Descriptionactivate-glowpoint-bank will always activate bank 0 even if we're activating a completely different glowpoint bank.

Bug can be seen in the attached mission. The only event turns off all the glowpoints on Alpha 1 and then turns bank 2 (the glowpoint on the bottom fin) on.

The result is bank 0 (the green light on the wing) and bank 2 turn on.

(Needs MediaVPs)
TagsNo tags attached.

Activities

Axem

2013-08-25 17:28

reporter  

niffiwan

2013-08-30 06:48

developer   ~0015253

Looks like the sexp function (sexp_activate_deactivate_glow_point_bank) is processing the 1st argument twice. Once for the ship lookup & once as a glowpoint bank. If this is correct, should be an easy fix.

niffiwan

2013-08-30 09:08

developer  

mantis2911-svn.patch (441 bytes)   
Index: code/parse/sexp.cpp
===================================================================
--- code/parse/sexp.cpp	(revision 9753)
+++ code/parse/sexp.cpp	(working copy)
@@ -15984,7 +15984,7 @@
 	sindex = ship_name_lookup(CTEXT(n), 1);
 	if (sindex >= 0)
 	{
-		for ( ; n != -1; n = CDR(n))
+		for ( n = CDR(n); n != -1; n = CDR(n))
 		{
 			num = eval_num(n);
 			if (num >= 0 && num < (int)Ships[sindex].glow_point_bank_active.size())
mantis2911-svn.patch (441 bytes)   

niffiwan

2013-08-30 09:10

developer   ~0015254

The (what I think are) baked glows around glowpoint bank 2 had me scratching my head for a while, but I'm pretty sure the attached patch fixes the problem.

niffiwan

2013-08-31 10:27

developer   ~0015256

Belatedly read the comments on IRC; with the patch, in the test mission the green wing glowpoint definitely stays off, but I was also modifying the test mission to check what happened with turning on other glowpoint banks. With glowpoint bank 2 on the Perseus it's very red at the bottom fin tip even with all glowpoints off. Maybe that's due to a baked glow, I'm not sure since I'm a near complete modeling noob :)

Anyway, I was hoping someone more experienced with modeling (Axem :)) could verify that the patch works as expected, in particular the effects on bank 2. After that, code review (although it really is a trivial change) & maybe commit in time for 3.7.0? :)

niffiwan

2013-09-03 10:28

developer   ~0015261

As requested, an exec for testing:
http://www.mediafire.com/download/4dxjyrvhuv4vpc7/fs2_open_3_7_1_SSE2_2911.7z

niffiwan

2013-09-11 07:51

developer   ~0015269

Fix committed to trunk@9780.

Related Changesets

fs2open: trunk r9780

2013-09-11 04:07

niffiwan


Ported: N/A

Details Diff
Fix mantis 2911: stop (de)activate-glow-point-bank sexp from processing the 1st arg twice Affected Issues
0002911
mod - /trunk/fs2_open/code/parse/sexp.cpp Diff File

Issue History

Date Modified Username Field Change
2013-08-25 17:28 Axem New Issue
2013-08-25 17:28 Axem File Added: mantis_glowpointbug.fs2
2013-08-30 06:48 niffiwan Note Added: 0015253
2013-08-30 09:08 niffiwan Assigned To => niffiwan
2013-08-30 09:08 niffiwan Status new => assigned
2013-08-30 09:08 niffiwan File Added: mantis2911-svn.patch
2013-08-30 09:10 niffiwan Note Added: 0015254
2013-08-30 09:10 niffiwan Status assigned => feedback
2013-08-31 10:27 niffiwan Note Added: 0015256
2013-09-03 10:28 niffiwan Note Added: 0015261
2013-09-11 07:51 niffiwan Changeset attached => fs2open trunk r9780
2013-09-11 07:51 niffiwan Note Added: 0015269
2013-09-11 07:51 niffiwan Status feedback => resolved
2013-09-11 07:51 niffiwan Resolution open => fixed