better default agent props & speed & position numeric, not strings
This commit is contained in:
@@ -207,14 +207,14 @@ class KeyframeView extends WindozDomContent {
|
||||
if(this.currentlySelectedAid && this.kfArena.agents[this.currentlySelectedAid]){
|
||||
const AgentValues = this.getFieldsValues('div[data-output="agentProperties"]')
|
||||
this.kfArena.agents[this.currentlySelectedAid].values = AgentValues
|
||||
const val = Number.parseInt(comp.value, 10)
|
||||
if((comp.name.startsWith('position.')) && (!Number.isNaN(val))){
|
||||
const val = Number(comp.value)
|
||||
if((comp.name.startsWith('position.')) && (Number.isFinite(val))){
|
||||
this.kfArena.moveAgent(this.currentlySelectedAid, {
|
||||
x: this.getFieldValue('div[data-output="agentProperties"]', 'position.x'),
|
||||
y: this.getFieldValue('div[data-output="agentProperties"]', 'position.y'),
|
||||
z: this.getFieldValue('div[data-output="agentProperties"]', 'position.z'),
|
||||
})
|
||||
} else if((comp.name.startsWith('speed.')) && (!Number.isNaN(val))){
|
||||
} else if((comp.name.startsWith('speed.')) && (Number.isFinite(val))){
|
||||
this.kfArena.changeAgentSpeed(this.currentlySelectedAid, {
|
||||
x: this.getFieldValue('div[data-output="agentProperties"]', 'speed.x'),
|
||||
y: this.getFieldValue('div[data-output="agentProperties"]', 'speed.y'),
|
||||
|
||||
Reference in New Issue
Block a user