Skip to content

Commit

Permalink
fix casting of seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
jxe committed Jun 10, 2011
1 parent 2141775 commit bf4756a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ceml/models/cast.rb
Expand Up @@ -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
Expand Down

0 comments on commit bf4756a

Please sign in to comment.