add variable system + fix bugs here and there.
This commit is contained in:
@@ -28,6 +28,7 @@ func (p *Pointer) AddAlias(alias string) (added *string, removed *string) {
|
||||
if strings.HasPrefix(alias, "lucifer:name:") {
|
||||
for i, alias2 := range p.Aliases {
|
||||
if strings.HasPrefix(alias2, "lucifer:name:") {
|
||||
p.Aliases = append(p.Aliases[:0:0], p.Aliases...)
|
||||
p.Aliases = append(p.Aliases[:i], p.Aliases[i+1:]...)
|
||||
removed = gentools.ShallowCopy(&alias2)
|
||||
break
|
||||
@@ -48,6 +49,7 @@ func (p *Pointer) RemoveAlias(alias string) bool {
|
||||
|
||||
for i, alias2 := range p.Aliases {
|
||||
if alias2 == alias {
|
||||
p.Aliases = append(p.Aliases[:0:0], p.Aliases...)
|
||||
p.Aliases = append(p.Aliases[:i], p.Aliases[i+1:]...)
|
||||
return true
|
||||
}
|
||||
|
||||
+10
-4
@@ -70,10 +70,16 @@ func (s State) Interpolate(s2 State, f float64) State {
|
||||
}
|
||||
|
||||
if s.Power != nil && s2.Power != nil {
|
||||
if f < 0.5 {
|
||||
newState.Power = gentools.ShallowCopy(s.Power)
|
||||
} else {
|
||||
newState.Power = gentools.ShallowCopy(s2.Power)
|
||||
if *s.Power == *s2.Power {
|
||||
newState.Power = s.Power
|
||||
}
|
||||
|
||||
// With power, interpolate strongly in the direction of power
|
||||
if *s.Power {
|
||||
newState.Power = gentools.Ptr(f < 0.95)
|
||||
}
|
||||
if *s2.Power {
|
||||
newState.Power = gentools.Ptr(f > 0.05)
|
||||
}
|
||||
} else if s.Power != nil {
|
||||
newState.Power = gentools.ShallowCopy(s.Power)
|
||||
|
||||
Reference in New Issue
Block a user