From bf4756abfbcd759688af28b66c8bc4dcebcf1cb8 Mon Sep 17 00:00:00 2001 From: Joe Edelman Date: Fri, 10 Jun 2011 16:00:31 -0700 Subject: [PATCH] fix casting of seeds --- lib/ceml/models/cast.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ceml/models/cast.rb b/lib/ceml/models/cast.rb index 874de14..ae6d087 100644 --- a/lib/ceml/models/cast.rb +++ b/lib/ceml/models/cast.rb @@ -24,6 +24,13 @@ def affinity role, guy needed = [role.range.min - casted_count, 0].max allowed = [role.range.max - casted_count, 0].max + if guy[:seeded] and seedrole = guy[:seeded].split(':').last + if seedrole != '*' and seedrole != role.name + # CEML.log 1, "no cast because #{seedrole} does not match #{role.name}" + return [-1, -1, -1] + end + end + return [-1, -1, -1 ] unless role.tagspec =~ guy and allowed > 0 [ role.tagspec.with.size, -needed, -allowed ] end