From a1d85248991a3b50783608d8d2ae35b4be29e82a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 25 Jul 2010 14:53:22 +0100 Subject: [PATCH] cope with unknown vessels by turning them unto zz vcunk --- yarrg/icons/vcunk.xbm | 5 +++++ yarrg/where-vessels | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 yarrg/icons/vcunk.xbm diff --git a/yarrg/icons/vcunk.xbm b/yarrg/icons/vcunk.xbm new file mode 100644 index 0000000..11f3f53 --- /dev/null +++ b/yarrg/icons/vcunk.xbm @@ -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}; diff --git a/yarrg/where-vessels b/yarrg/where-vessels index c6636d6..5af2dfa 100755 --- a/yarrg/where-vessels +++ b/yarrg/where-vessels @@ -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 -- 2.30.2