changeset 981:25ed3da96f88

Use prgetval() and get rid of /eval /set where appropriate.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 31 Mar 2009 19:41:25 +0000
parents 9d3182edd64d
children 60ca44cdc9e0
files gm-pplacer.tf
diffstat 1 files changed, 16 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/gm-pplacer.tf	Tue Mar 31 15:02:28 2009 +0000
+++ b/gm-pplacer.tf	Tue Mar 31 19:41:25 2009 +0000
@@ -5,7 +5,7 @@
 ;; This file (triggerset) is Free Software distributed under
 ;; GNU General Public License version 2.
 ;;
-;; NOTICE! This file requires GgrTF (version 0.6.2 or later) to be loaded.
+;; NOTICE! This file requires GgrTF (version 0.6.11 or later) to be loaded.
 ;;
 /loaded GgrTF::PartyPlacer
 /set gmodule=PartyPlacer
@@ -27,15 +27,13 @@
 		/let _ccol=3%;\
 		/while (_ccol>0) \
 			/let _gps=%{_crow}_%{_ccol}%;\
-			/eval /set gtestpos=$$[gparty_%{_gps}_s]%;\
-			/if (gtestpos=~{1}) \
-				/return _gps%;\
-			/endif%;\
+			/let _tps=$[prgetval(strcat("gparty_",_gps,"_s"))]%;\
+			/if (_tps=~{1}) /return _gps%;/endif%;\
 			/let _ccol=$[_ccol-1]%;\
 		/done%;\
 		/let _crow=$[_crow-1]%;\
 	/done%;\
-	/return
+	/return ""
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -63,19 +61,19 @@
 		/let _ccol=3%;\
 		/while (_ccol>0) \
 			/let _gps=%{_crow}_%{_ccol}%;\
-			/eval /set gcurpos=$$[gparty_%{_gps}_s]%;\
-			/eval /set gwantpos=$$[gparty_%{_gps}_fs]%;\
-			/if (gcurpos!~gwantpos) \
-				/if (gcurpos!~"" & gwantpos!~"") \
-					@@party swap %{gcurpos} %{gwantpos}%;\
-					/let _gfpos=$[gparty_getpos(gwantpos)]%;\
-					/set gparty_%{_gfpos}_s=%{gcurpos}%;\
-					/set gparty_%{_gps}_s=%{gwantpos}%;\
-				/elseif (gwantpos!~"") \
-					@@party place %{gwantpos} %{_crow},%{_ccol}%;\
-					/let _gfpos=$[gparty_getpos(gwantpos)]%;\
+			/let _gcur=$[prgetval(strcat("gparty_",_gps,"_s"))]%;\
+			/let _gwant=$[prgetval(strcat("gparty_",_gps,"_fs"))]%;\
+			/if (_gcur!~_gwant) \
+				/if (_gcur!~"" & _gwant!~"") \
+					@@party swap %{_gcur} %{_gwant}%;\
+					/let _gfpos=$[gparty_getpos(_gwant)]%;\
+					/set gparty_%{_gfpos}_s=%{_gcur}%;\
+					/set gparty_%{_gps}_s=%{_gwant}%;\
+				/elseif (_gwant!~"") \
+					@@party place %{_gwant} %{_crow},%{_ccol}%;\
+					/let _gfpos=$[gparty_getpos(_gwant)]%;\
 					/set gparty_%{_gfpos}_s=%;\
-					/set gparty_%{_gps}_s=%{gwantpos}%;\
+					/set gparty_%{_gps}_s=%{_gwant}%;\
 				/endif%;\
 			/endif%;\
 			/let _ccol=$[_ccol-1]%;\