Fix compile issues within the states script file

This commit is contained in:
Youssof 2024-06-06 14:43:49 -03:00
parent a2880c7bce
commit d55ab0e57a
1 changed files with 10 additions and 5 deletions

View File

@ -312,8 +312,9 @@ function lj_sum(rid, data, accum) {
function lennardjones() { function lennardjones() {
BVMSTATE="POTENTIAL" BVMSTATE="POTENTIAL"
check_rc_wp() check_rc_wp()
if(V_TYPE == 2) # NOT MOVING! if(V_TYPE == 2){ # NOT MOVING!
return return
}
# Calculate accumulator # Calculate accumulator
accum_lj = neighbors.map(lj_vector).reduce(lj_sum, math.vec2.new(0.0, 0.0)) accum_lj = neighbors.map(lj_vector).reduce(lj_sum, math.vec2.new(0.0, 0.0))
if(neighbors.count() > 0) if(neighbors.count() > 0)
@ -345,13 +346,16 @@ function voronoicentroid() {
BVMSTATE="DEPLOY" BVMSTATE="DEPLOY"
check_rc_wp() check_rc_wp()
wptab = v_wp.get(WPtab_id) wptab = v_wp.get(WPtab_id)
if(wptab==nil) if(wptab==nil){
return return
else if(not(size(wptab) > 0)) }
else if(not(size(wptab) > 0)){
return return
}
log("WP table size:", size(wptab)) log("WP table size:", size(wptab))
if(V_TYPE == 2) if(V_TYPE == 2){
return return
}
it_pts = 0 it_pts = 0
att = {} att = {}
foreach(wptab, function(key, value){ foreach(wptab, function(key, value){
@ -371,8 +375,9 @@ function voronoicentroid() {
# Boundaries from user attractors # Boundaries from user attractors
#att = {.0=vec_from_gps(45.510283, -73.609633, 0), .1=vec_from_gps(45.510398, -73.609281, 0)} #att = {.0=vec_from_gps(45.510283, -73.609633, 0), .1=vec_from_gps(45.510398, -73.609281, 0)}
bounds = QuickHull(att) bounds = QuickHull(att)
if(size(bounds)<3 ) if(size(bounds)<3 ){
return return
}
if(counter==0) { if(counter==0) {
pts = {.np=size(bounds)} pts = {.np=size(bounds)}
it_pts = 0 it_pts = 0