From: Ian Jackson Date: Sun, 25 Jul 2010 13:53:22 +0000 (+0100) Subject: cope with unknown vessels by turning them unto zz vcunk X-Git-Tag: 6.6.0~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=a1d85248991a3b50783608d8d2ae35b4be29e82a;ds=sidebyside cope with unknown vessels by turning them unto zz vcunk --- 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