Not logged inOpenClonk Forum
Up Topic Development / Scenario & Object Development / Content-Correction
- - By Gurkenglas [de] Date 2010-03-31 19:14 Edited 2010-04-03 17:10
Using c4dt (Eclipse-Plugin Clonk 4 Development Tools), i found many Syntax faults in planet/.
Alas, i commited after a change and so it are now 2 patches :/
Patches attached.

Edit: Patch fixed.
Attachment: change1097.diff - Patch with commit 1097 (808B)
Attachment: change1098.diff - Patch with commit 1098 (10k)
Attachment: 1117.diff - Patch with commit 1117 (8k)
Reply
Parent - - By Clonk-Karl [de] Date 2010-03-31 19:29

> -  var result = inherited(plr,ctrl,strength,release,...);
> +  var result = _inherited(plr,ctrl,strength,release,...);


What exactly is the problem here?

> -    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=--iCount;
> +    }


Note that this changes the behaviour if the Cloud object is not loaded. Probably not worth thinking about though. Would be cool if you could adhere to the C4Script style guidelines here though.
Reply
Parent - - By Caesar [de] Date 2010-03-31 19:33
What is iCount=--iCount anyway?
Parent - By Clonk-Karl [de] Date 2010-03-31 19:36
The same as --iCount. Right, that can be simplified.
Reply
Parent - - By Gurkenglas [de] Date 2010-03-31 21:11
@inherited->_inherited: The function does not inherite anything, so I made it failsafe.
Reply
Parent - By Newton [de] Date 2010-03-31 22:29
Yes it does. It is even mentioned in the comment above!
Parent - - By Caesar [de] Date 2010-03-31 19:35 Edited 2010-04-01 17:55
this()->SetCommand("None");
Well... this() is a crime anyway, and this()-> should cause the guillotine.

>-  if (pos == nil) return _inherited(item,ignoreOCF);
>+  if (pos == nil) return _inherited(item);


Could you explain that? (I don't get the idea behind inherited in an object that appends to nothing, but that's not the problem.)

>+public func ReleaseAllowed() { return ObjectCount(Find_ID(C4Id("REAC"))); }
>+public func AtConstructionSite() { return !Contained() && FindConstructionSite() && ObjectCount(Find_ID(C4Id("CNMT"))); }


Those definitions don't exist anymore. And why should one use C4Id here? (I know that that's not your fault.)
Parent - - By Clonk-Karl [de] Date 2010-03-31 19:51

> Could you explain that? (I don't get the idea behind inherited in an object that appends to nothing, but that's not the problem.)


Collect is also an engine function. I don't understand the change though. Why is ignoreOCF no longer passed to the engine function?
Reply
Parent - - By Gurkenglas [de] Date 2010-03-31 21:03
Because in the engine function theres no ignoreOCF-parameter.
Reply
Parent - By Clonk-Karl [de] Date 2010-03-31 21:57
There is.
Reply
Parent - By Ringwaul [ca] Date 2010-03-31 20:27

>this()->SetCommand("None");


...what the heck?
Reply
Parent - By Gurkenglas [de] Date 2010-03-31 21:03
Ok, in this()-> i didnt think enough.
Reply
Parent - By Newton [de] Date 2010-03-31 22:35

>-  if (pos == nil) return _inherited(item,ignoreOCF);
>+  if (pos == nil) return _inherited(item);


This is wrong.
Parent - By Clonk-Karl [de] Date 2010-04-05 16:37
I pushed that revised patch.
Reply
Up Topic Development / Scenario & Object Development / Content-Correction

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill