better default agent props & speed & position numeric, not strings

This commit is contained in:
STEINNI
2026-06-21 12:08:25 +00:00
parent 54db203e86
commit 06a7868882
5 changed files with 106 additions and 9 deletions
+3 -3
View File
@@ -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'),