# HG changeset patch
# User Gurkilein
# Date 1270310161 -7200
# Node ID 11412eb711f93bd54b6903c8fdd4be77d224410b
# Parent  af699490de5d81af728a07f32b7906af608079cc
Fixed some parameter mistakes and typos and replaced if(a)b()&&c(); with if(a){b();c();}

diff -r af699490de5d -r 11412eb711f9 planet/Objects.c4d/Animals.c4d/Wolf.c4d/Script.c
--- a/planet/Objects.c4d/Animals.c4d/Wolf.c4d/Script.c	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Objects.c4d/Animals.c4d/Wolf.c4d/Script.c	Sat Apr 03 17:56:01 2010 +0200
@@ -114,28 +114,28 @@
 {
 	// Move command
 	if (szCommand == "MoveTo")
-		return SetCommand(this(),szCommand, pTarget, iTx, iTy);
+		return SetCommand(szCommand, pTarget, iTx, iTy);
 	return 0;
 }
 
 protected func ContainedLeft(object caller)
 {
 	[$TxtMovement$]
-	SetCommand(this(), "None");
+	SetCommand("None");
 	return 1;
 }
 
 protected func ContainedRight(object caller)
 {
 	[$TxtMovement$]
-	SetCommand(this(), "None");
+	SetCommand("None");
 	return 1;
 }
 
 protected func ContainedUp(object caller)
 {
 	[$TxtMovement$]
-	SetCommand(this(), "None");
+	SetCommand("None");
 	
 	if (GetAction() == "Swim")
 	{
@@ -149,8 +149,8 @@
 protected func ContainedDown(object caller)
 {
 	[$TxtMovement$]
-	SetCommand(this(), "None");
-	if(Contained()) SetCommand(this, "Exit");
+	SetCommand("None");
+	if(Contained()) SetCommand("Exit");
 	if (GetAction() == "Swim")
 	{
 		return 1;
diff -r af699490de5d -r 11412eb711f9 planet/Objects.c4d/Environment.c4d/Clouds.c4d/Cloud.c4d/Script.c
--- a/planet/Objects.c4d/Environment.c4d/Clouds.c4d/Cloud.c4d/Script.c	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Objects.c4d/Environment.c4d/Clouds.c4d/Cloud.c4d/Script.c	Sat Apr 03 17:56:01 2010 +0200
@@ -95,11 +95,13 @@
 	if(GetMaterial(0, iSearchY) != Material("Water") && GetMaterial(0, iSearchY) != Material("Acid") && GetMaterial(0, iSearchY) != Material("Sky")) return(iSearchY=0);
 	if(GetMaterial(0, iSearchY) == Material("Water")) 
 	{
-		ExtractMaterialAmount(0, iSearchY,Material("Water"), 3) &&
-		(iSize = iSize+3);
+		ExtractMaterialAmount(0, iSearchY,Material("Water"), 3);
+		iSize = iSize+3;
 	}
-	if(ObjectCount(Find_ID(Environment_AcidRain))>=1 && GetMaterial(0, iSearchY) == Material("Acid")) ExtractMaterialAmount(0, iSearchY,Material("Acid"), 3) &&
-		(iAcidity = iAcidity+3);
+	if(ObjectCount(Find_ID(Environment_AcidRain))>=1 && GetMaterial(0, iSearchY) == Material("Acid")) {
+		ExtractMaterialAmount(0, iSearchY,Material("Acid"), 3);
+		iAcidity = iAcidity+3;
+	}
 	if(GetMaterial(0, iSearchY) != Material("Water") && GetMaterial(0, iSearchY) != Material("Acid"))
 		iSearchY = iSearchY + iPrecision;
 	if(iSearchY >= LandscapeHeight()-GetY()) (iSearchY = 0);
diff -r af699490de5d -r 11412eb711f9 planet/Objects.c4d/Environment.c4d/Clouds.c4d/Script.c
--- a/planet/Objects.c4d/Environment.c4d/Clouds.c4d/Script.c	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Objects.c4d/Environment.c4d/Clouds.c4d/Script.c	Sat Apr 03 17:56:01 2010 +0200
@@ -27,7 +27,10 @@
 
 	while(iCount!=0)
 	{
-		if(FindPosInMat(iX, iY, "Sky", 0,0,LandscapeWidth(), LandscapeHeight()) && MaterialDepthCheck(iX,iY,"Sky",200)==true) CreateObject(Cloud, iX, iY, NO_OWNER) && (iCount=--iCount);
+		if(FindPosInMat(iX, iY, "Sky", 0,0,LandscapeWidth(), LandscapeHeight()) && MaterialDepthCheck(iX,iY,"Sky",200)==true) {
+			CreateObject(Cloud, iX, iY, NO_OWNER);
+			iCount--;
+		}
 	}
 	AdjustLightningFrequency(GetScenarioVal("Lightning"));
 }
diff -r af699490de5d -r 11412eb711f9 planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Menupoint.c4d/DefCore.txt
--- a/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Menupoint.c4d/DefCore.txt	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Objects.c4d/HUD.c4d/Ringmenu.c4d/Menupoint.c4d/DefCore.txt	Sat Apr 03 17:56:01 2010 +0200
@@ -6,4 +6,4 @@
 Height=64
 Offset=-32,-32
 StretchGrowth=1
-Rotate=1;
\ No newline at end of file
+Rotate=1
\ No newline at end of file
diff -r af699490de5d -r 11412eb711f9 planet/Objects.c4d/Items.c4d/Resources.c4d/Gold.c4d/Script.c
--- a/planet/Objects.c4d/Items.c4d/Resources.c4d/Gold.c4d/Script.c	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Objects.c4d/Items.c4d/Resources.c4d/Gold.c4d/Script.c	Sat Apr 03 17:56:01 2010 +0200
@@ -7,7 +7,7 @@
 		SetGraphics(Format("%d",graphic));
 }
 
-protected func Hit()
+protected func Hit()
 {
 	Sound("RockHit*");
 	return 1;
diff -r af699490de5d -r 11412eb711f9 planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c
--- a/planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c	Sat Apr 03 17:56:01 2010 +0200
@@ -18,8 +18,8 @@
 
 private func Hit()
 {
-Sound("WoodHit");
-if(iVolume>=1 && Closed==false) {
+	Sound("WoodHit");
+	if(iVolume>=1 && Closed==false) {
 		if(GBackLiquid(0,iDrain) && GetMaterial(0,iDrain)!=szLiquid) return 0;
 		EmptyBarrel(GetR());
 		Sound(" "); //water splash sound should be added when available -Ringwaul
@@ -34,8 +34,10 @@
 	if(GetMaterial(0,iSource)== Material("Water") && Closed==false) FillBarrel("Water");
 	//if(GetMaterial(0,iSource)== Material("Oil") && Closed==false) FillBarrel("Oil"); //No oil material in current build -Ringwaul/Dec10
 
-	if(iVolume==0) SetGraphics() && szLiquid=nil;
-
+	if(iVolume==0) {
+		SetGraphics();
+		szLiquid=nil;
+	}
 	//Debug/Testing Purposes
 	if(debug == 1) Message("Volume:|%d|Liquid:|%s", this(), iVolume, szLiquid);
 }
@@ -63,7 +65,10 @@
 
 public func ControlUse(object pByClonk, int iX, int iY)
 {
-	if(Closed==true) Closed=false && Sound(" "); //Wood scrape sound
+	if(Closed==true) {
+		Closed=false;
+		Sound(" "); //Wood scrape sound
+	}
 
 	var AimAngle=Angle(0,0, iX, iY);
 	if(iVolume>=1)
diff -r af699490de5d -r 11412eb711f9 planet/Objects.c4d/Libraries.c4d/ContextMenu.c4d/Script.c
--- a/planet/Objects.c4d/Libraries.c4d/ContextMenu.c4d/Script.c	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Objects.c4d/Libraries.c4d/ContextMenu.c4d/Script.c	Sat Apr 03 17:56:01 2010 +0200
@@ -43,7 +43,7 @@
 	[$TxtEnergysupply$|Image=CXEC|Condition=AtEnergySite]
 	var pSite; 
 	if (pSite = FindEnergySite())
-		SetCommand(this, "Energy", pSite);
+		SetCommand("Energy", pSite);
 	return 1;
 }
 
diff -r af699490de5d -r 11412eb711f9 planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c
--- a/planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c	Sat Apr 03 17:56:01 2010 +0200
@@ -82,7 +82,7 @@
 {
 	if(ContentsCount() < MaxContents()) { Sound("Clonk"); return 0; }
 	if(pObj->Contained()) return Message("$TxtLorryisfull$", this);
-	if(Abs(GetXDir(pObj))>6) SetYDir(-5,pObj);
+	if(Abs(pObj->GetXDir())>6) pObj->SetYDir(-5);
 	Sound("WoodHit*");
 	return 1;
 }
diff -r af699490de5d -r 11412eb711f9 planet/System.c4g/Commits.c
--- a/planet/System.c4g/Commits.c	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/System.c4g/Commits.c	Sat Apr 03 17:56:01 2010 +0200
@@ -109,9 +109,7 @@
 // Checks whether the indicated definition is available.
 global func FindDefinition(id def)
 {
-	if (GetDefCoreVal("id", "DefCore", def)) 
-		return true;
-	return false;
+	return def->GetDefCoreVal("id", "DefCore");
 }
 
 // Creates amount objects of type id inside the indicated rectangle(optional) in the indicated material. 
@@ -121,7 +119,7 @@
 	var i, j;
 	var rndx, rndy, obj;
 	var mtype, mat;
-	var func, objhgt = GetDefCoreVal("Height", "DefCore", id);
+	var func, objhgt = id->GetDefCoreVal("Height", "DefCore");
 	
 	mat = Material(mat_str);
 	// Some failsavety.
diff -r af699490de5d -r 11412eb711f9 planet/Tests.c4f/Clonk50.c4s/Clonk.c4d/DefCore.txt
--- a/planet/Tests.c4f/Clonk50.c4s/Clonk.c4d/DefCore.txt	Fri Apr 02 16:07:04 2010 +0200
+++ b/planet/Tests.c4f/Clonk50.c4s/Clonk.c4d/DefCore.txt	Sat Apr 03 17:56:01 2010 +0200
@@ -38,7 +38,7 @@
 Dig=20000
 Swim=30000
 Throw=25000
-Push=200s00
+Push=20000
 Fight=25000
 CanDig=1
 CanConstruct=1
