#149 g_diff fails to see BoT Orientation change.

closed-fixed
5
2008-01-17
2008-01-07
David Loman
No

I recently had to parse a .g file and re-orient all the BoTs contained within to 'no' instead of 'lh' or 'rh'.

I used a very simple TCL script to do this:

*************************
proc OrientAllBots { orient } {

if { [llength $orient] != 1 } { return "Usage OrientAllBots no|lh|rh " }

set cnt 0

if { $orient == "no" || $orient == "lh" || $orient == "rh" } {

set allObjs [t -s]

foreach obj $allObjs {
if { [ db get_type $obj ] == "bot" } {
db adjust $obj orient $orient
incr cnt
}
}
return "$cnt BoTs oriented to $orient"
} else {
return "Usage OrientAllBots no|lh|rh "
}
}
***************************

I wanted to generate a 'Change Log' from this, so I tried using g_diff to list all the soilds that my script had just changed.

File01.g was the original and File02.g was the file that I ran my script on.

Running:
g_diff File01.g File02.g
Yields:

**************************

Changes from File01.g to File02.g

No differences.
**************************

And running:
g_diff -m File01.g File02.g
Yields:

**************************
db adjust left_armor_external003.s
db adjust top_upper029.s
db adjust left_armor_external002.s
db adjust lt_door_internals028.s
db adjust rt_door_internals043.s
db adjust finalair009.s
db adjust finalair008.s
db adjust finalair007.s
db adjust finalair006.s
db adjust finalair005.s
db adjust finalair004.s
db adjust finalair003.s
db adjust finalair002.s
db adjust rim04.s
db adjust rim03.s
db adjust finalair001.s
db adjust rim02.s
db adjust rim01.s
No differences.
**************************

Now while the output using the -m option lists the things I needed g_diff to list, it did NOT generate a viable TCL script to run.

Discussion

  • John Anderson

    John Anderson - 2008-01-17
    • assigned_to: nobody --> johnranderson
    • status: open --> closed-fixed
     
  • John Anderson

    John Anderson - 2008-01-17

    Logged In: YES
    user_id=1185553
    Originator: NO

    fixed incorrect use of strcmp()

     

Log in to post a comment.