forked from pyrex/chameleonic
		
	ff to current state #6
| @@ -1521,9 +1521,10 @@ function rope:_calc_push( | |||||||
|  local ops={} |  local ops={} | ||||||
|  if (an==nil) return ops |  if (an==nil) return ops | ||||||
|  local pull_ang=atan2( |  local pull_ang=atan2( | ||||||
|   a0.x\8 - an.x\8, |   a0.x\8-an.x\8, | ||||||
|   a0.y\8-an.y\8 |   a0.y\8-an.y\8 | ||||||
|  ) |  ) | ||||||
|  |  local needs_good_pull=af==nil  | ||||||
|  |  | ||||||
|  if a0.x==a1.x then |  if a0.x==a1.x then | ||||||
|   -- no far side applying pressure? |   -- no far side applying pressure? | ||||||
| @@ -1536,15 +1537,15 @@ function rope:_calc_push( | |||||||
|    |    | ||||||
|   local mx,dmx |   local mx,dmx | ||||||
|   if a0.x%8==0 and a0.x>an.x+7 then |   if a0.x%8==0 and a0.x>an.x+7 then | ||||||
|    local needs_good_pull=af==nil or af.x>=a1.x |    needs_good_pull=needs_good_pull or af.x>=a1.x | ||||||
|    if (needs_good_pull and _ang_diff(pull_ang,0.5)>=0.125) return {} |    if (needs_good_pull and _ang_diff(pull_ang,0.0)>=0.125) return {} | ||||||
|  |  | ||||||
|    -- push left |    -- push left | ||||||
|    mx=(a0.x-1)\8 |    mx=(a0.x-1)\8 | ||||||
|    dmx=-1 |    dmx=-1 | ||||||
|   elseif a0.x%8==7 and a0.x<an.x-7 then |   elseif a0.x%8==7 and a0.x<an.x-7 then | ||||||
|    local needs_good_pull=af==nil or af.x<=a1.x |    needs_good_pull=needs_good_pull or af.x<=a1.x | ||||||
|    if (needs_good_pull and _ang_diff(pull_ang,0.0)>=0.125) return {} |    if (needs_good_pull and _ang_diff(pull_ang,0.5)>=0.125) return {} | ||||||
|  |  | ||||||
|    -- push right |    -- push right | ||||||
|    mx=(a0.x+1)\8 |    mx=(a0.x+1)\8 | ||||||
| @@ -1568,7 +1569,7 @@ function rope:_calc_push( | |||||||
|    |    | ||||||
|   local my,dmy |   local my,dmy | ||||||
|   if a0.y%8==0 and a0.y>an.y+6 then |   if a0.y%8==0 and a0.y>an.y+6 then | ||||||
|    local needs_good_pull=af==nil or af.x>=a1.x |    needs_good_pull=needs_good_pull or af.y>=a1.y | ||||||
|    if (needs_good_pull and _ang_diff(pull_ang,0.75)>=0.125) return {} |    if (needs_good_pull and _ang_diff(pull_ang,0.75)>=0.125) return {} | ||||||
|  |  | ||||||
|    -- push up |    -- push up | ||||||
| @@ -1576,7 +1577,7 @@ function rope:_calc_push( | |||||||
|    dmy=-1 |    dmy=-1 | ||||||
|     |     | ||||||
|   elseif a0.y%8==7 and a0.y<an.y-6 then |   elseif a0.y%8==7 and a0.y<an.y-6 then | ||||||
|    local needs_good_pull=af==nil or af.x>=a1.x |    needs_good_pull=needs_good_pull or af.y<=a1.y | ||||||
|    if (needs_good_pull and _ang_diff(pull_ang,0.25)>=0.125) return {} |    if (needs_good_pull and _ang_diff(pull_ang,0.25)>=0.125) return {} | ||||||
|  |  | ||||||
|    -- push down |    -- push down | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user