View Issue Details

IDProjectCategoryView StatusLast Update
0001963FSSCPFREDpublic2010-10-08 12:21
ReporterAce Assigned ToThe_E  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version3.6.13 
Summary0001963: Bank (optional) command not functioning in set-object-facing and set-object-facing-object SEXPs
DescriptionThe bank command in this coordinate manipulation SEXP is non-functional. Ships will not bank in-mission when this event triggers if a banking value is set.
TagsNo tags attached.

Activities

portej05

2009-07-19 07:33

reporter   ~0011093

Could you please provide a test case/mission for this bug.

karajorma

2009-08-03 21:52

administrator   ~0011123

As I said on HLP, Bank appears to simply act as a Boolean saying whether the ship should bank or not while making the turn.

Thing is, I'm not certain it's supposed to act that way. Look at void sexp_set_object_orient() in mission parse.

The_E

2010-10-08 11:41

administrator   ~0012403

Patch attached. Might break missions that use the bank argument.

2010-10-08 11:41

 

1963.patch (1,873 bytes)   
Index: sexp.cpp
===================================================================
--- sexp.cpp	(revision 6578)
+++ sexp.cpp	(working copy)
@@ -6113,10 +6113,14 @@
 	if (turn_time)
 	{
 		// set flag
-		bank = bank ? AITTV_IGNORE_BANK : 0;
+		int bankflag = 0;
+		if (bank) 
+		{
+			bankflag = AITTV_IGNORE_BANK;
+		}
 
 		// turn
-		ai_turn_towards_vector(location, objp, flFrametime, float(turn_time)/(1000.0f), NULL, NULL, 0.0f, 0, NULL, (AITTV_VIA_SEXP | bank));
+		ai_turn_towards_vector(location, objp, flFrametime, float(turn_time)/(1000.0f), NULL, NULL, 0.0f, 0, NULL, (AITTV_VIA_SEXP | bankflag));
 
 		// return
 		return;
@@ -6229,7 +6233,7 @@
 	}
 	if (n != -1)
 	{
-		bank = eval_num(n);
+		bank = eval_sexp(n);
 	}
 
 	sexp_set_oswpt_facing(&oswpt1, location, turn_time, bank);
@@ -20519,14 +20523,18 @@
 				return OPF_SHIP_WING_POINT;
 			else if (argnum < 4)
 				return OPF_NUMBER;
+			else if (argnum == 4)
+				return OPF_POSITIVE;
 			else
-				return OPF_POSITIVE;
+				return OPF_BOOL;
 
 		case OP_SET_OBJECT_FACING_OBJECT:
 			if (argnum == 0 || argnum == 1)
 				return OPF_SHIP_WING_POINT;
+			else if (argnum == 2)
+				return OPF_POSITIVE;
 			else
-				return OPF_POSITIVE;
+				return OPF_BOOL;
 
 		case OP_SHIP_MANEUVER:
 			if (argnum == 0)
@@ -24231,7 +24239,7 @@
 		"\t3: The Y coordinate to face.\r\n"
 		"\t4: The Z coordinate to face.\r\n"
 		"\t5: Turn time in milliseconds (optional)\r\n"
-		"\t6: Bank (optional)" },
+		"\t6: Bank (optional, boolean value)" },
 
 	// Goober5000
 	{ OP_SET_OBJECT_FACING_OBJECT, "set-object-facing-object\r\n"
@@ -24240,7 +24248,7 @@
 		"\t1: The name of an object.\r\n"
 		"\t2: The object to face.\r\n"
 		"\t3: Turn time in milliseconds (optional)\r\n"
-		"\t4: Bank (optional)" },
+		"\t4: Bank (optional, boolean value)" },
 
 	// Wanderer
 	{ OP_SHIP_MANEUVER, "ship-maneuver\r\n"
1963.patch (1,873 bytes)   

The_E

2010-10-08 12:01

administrator   ~0012405

Non-breaking patch committed in revision 6579

Issue History

Date Modified Username Field Change
2009-07-15 23:59 Ace New Issue
2009-07-19 07:33 portej05 Note Added: 0011093
2009-08-03 21:52 karajorma Note Added: 0011123
2010-10-08 11:41 The_E Note Added: 0012403
2010-10-08 11:41 The_E File Added: 1963.patch
2010-10-08 12:01 The_E Note Added: 0012405
2010-10-08 12:02 The_E Status new => closed
2010-10-08 12:02 The_E Resolution open => fixed
2010-10-08 12:02 The_E Fixed in Version => 3.6.13
2010-10-08 12:21 The_E Status closed => feedback
2010-10-08 12:21 The_E Resolution fixed => reopened
2010-10-08 12:21 The_E Status feedback => resolved
2010-10-08 12:21 The_E Resolution reopened => fixed
2010-10-08 12:21 The_E Assigned To => The_E