chiark / gitweb /
cope with unknown vessels by turning them unto zz vcunk
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 25 Jul 2010 13:53:22 +0000 (14:53 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 25 Jul 2010 13:53:22 +0000 (14:53 +0100)
yarrg/icons/vcunk.xbm [new file with mode: 0644]
yarrg/where-vessels

diff --git a/yarrg/icons/vcunk.xbm b/yarrg/icons/vcunk.xbm
new file mode 100644 (file)
index 0000000..11f3f53
--- /dev/null
@@ -0,0 +1,5 @@
+#define vcunk_width 12
+#define vcunk_height 10
+static unsigned char vcunk_bits[] = {
+   0xf8, 0x01, 0x0c, 0x03, 0x0c, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00,
+   0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00};
index c6636d6..5af2dfa 100755 (executable)
@@ -275,6 +275,8 @@ proc vesselclasses-init {} {
     manyset $vessel_class_data classinfos subclassinfos
 
     set vc_codes {}
+    set vc_code2abbrev(zz) vcunk
+    load-icon vcunk
     foreach {game code abbrev full} $classinfos {
        if {![regexp {^[a-z][a-z]$} $code code]} { error "bad code" }
        if {![regexp {^[a-z][a-z]$} $abbrev abbrev]} { error "bad abbrev" }
@@ -602,8 +604,11 @@ proc vessel {vin} {
 
     set gameclass [errexpect-arrayget vi vesselClass]
     upvar #0 vc_game2code($gameclass) class
-    if {![info exists class]} { errexpect-error "unexpected vesselClass"}
-    lappend codel $class
+    if {[info exists class]} {
+       lappend codel $class
+    } else {
+       lappend codel zz
+    }
 
     set gamesubclass [errexpect-arrayget vi vesselSubclass]
     upvar #0 vsc_game2code($gamesubclass) subclass