Fix inherited() calls

The ... operator should be added so that the parameters are passed down. In some cases even the named parameters were not passed down.
directional-lights
Mark 2016-11-26 18:57:31 +01:00
parent 94ec4e336b
commit d356d9db3d
36 changed files with 50 additions and 50 deletions

View File

@ -8,7 +8,7 @@
func Initialize() func Initialize()
{ {
return _inherited(); return _inherited(...);
} }
public func ControlUse(object pClonk, int ix, int iy) public func ControlUse(object pClonk, int ix, int iy)

View File

@ -7,7 +7,7 @@ local fast;
func Initialize() func Initialize()
{ {
fast = 0; fast = 0;
_inherited(); _inherited(...);
} }
func MakeFast(int f) { fast = f; } func MakeFast(int f) { fast = f; }

View File

@ -4,5 +4,5 @@
func Initialize() func Initialize()
{ {
AddEffect("Lifesteal", this, 100, 0, nil); AddEffect("Lifesteal", this, 100, 0, nil);
_inherited(); _inherited(...);
} }

View File

@ -12,7 +12,7 @@ private func Stick()
fade_out_forced = true; fade_out_forced = true;
if (g_object_fade) AddEffect("IntFadeOut", this, 100, 1, g_object_fade, Rule_ObjectFade); if (g_object_fade) AddEffect("IntFadeOut", this, 100, 1, g_object_fade, Rule_ObjectFade);
} }
_inherited(); _inherited(...);
} }
public func FadeOutForced() { return fade_out_forced; } public func FadeOutForced() { return fade_out_forced; }

View File

@ -114,7 +114,7 @@ public func HasInteractionMenu() { return true; }
// Show settins in interaction menu // Show settins in interaction menu
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var cablecar_menu = var cablecar_menu =
{ {
title = "$CableCarOptions$", title = "$CableCarOptions$",

View File

@ -25,7 +25,7 @@ public func CableDeactivation(int count) { }
/*--- Callbacks ---*/ /*--- Callbacks ---*/
// Be sure to always call these via _inherited(); // Be sure to always call these via _inherited(...);
func Initialize() func Initialize()
{ {

View File

@ -41,7 +41,7 @@ public func HasInteractionMenu() { return true; }
// Show settings in interaction menu // Show settings in interaction menu
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var crossing_menu = var crossing_menu =
{ {
title = "$StationSettings$", title = "$StationSettings$",

View File

@ -180,7 +180,7 @@ public func GetExtensionMenuEntries(object clonk)
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var menu = var menu =
{ {
title = "$ReinforceScaffold$", title = "$ReinforceScaffold$",

View File

@ -56,7 +56,7 @@ private func GetAttraction(proplist coordinates)
private func MissionComplete() private func MissionComplete()
{ {
if (!attraction) return _inherited(); if (!attraction) return _inherited(...);
var wait = 20 + Random(80); var wait = 20 + Random(80);
// Slow animation speed // Slow animation speed
fly_anim = PlayAnimation("Fly", 1, Anim_Linear(GetAnimationPosition(fly_anim), 0, fly_anim_len, 20, ANIM_Loop)); fly_anim = PlayAnimation("Fly", 1, Anim_Linear(GetAnimationPosition(fly_anim), 0, fly_anim_len, 20, ANIM_Loop));
@ -78,14 +78,14 @@ private func RegularSpeed()
private func SleepComplete() private func SleepComplete()
{ {
fly_anim = PlayAnimation("Fly", 1, Anim_Linear(GetAnimationPosition(fly_anim), 0, fly_anim_len/2, 10, ANIM_Hold)); fly_anim = PlayAnimation("Fly", 1, Anim_Linear(GetAnimationPosition(fly_anim), 0, fly_anim_len/2, 10, ANIM_Hold));
_inherited(); _inherited(...);
} }
// Restart the animation // Restart the animation
private func WakeUp() private func WakeUp()
{ {
fly_anim = PlayAnimation("Fly", 1, Anim_Linear(GetAnimationPosition(fly_anim), 0, fly_anim_len, 10, ANIM_Loop)); fly_anim = PlayAnimation("Fly", 1, Anim_Linear(GetAnimationPosition(fly_anim), 0, fly_anim_len, 10, ANIM_Loop));
_inherited(); _inherited(...);
} }
private func GetRestingPlace(proplist coordinates) private func GetRestingPlace(proplist coordinates)

View File

@ -81,14 +81,14 @@ private func MissionComplete()
private func Sleep() private func Sleep()
{ {
this.Visibility = VIS_None; this.Visibility = VIS_None;
_inherited(); _inherited(...);
} }
private func WakeUp() private func WakeUp()
{ {
this.Visibility = VIS_All; this.Visibility = VIS_All;
_inherited(); _inherited(...);
} }
// Action end call. // Action end call.

View File

@ -16,12 +16,12 @@ private func Initialize()
SetAction("Fly"); SetAction("Fly");
SetPhase(Random(3)); SetPhase(Random(3));
_inherited(); _inherited(...);
} }
private func Death() private func Death()
{ {
_inherited(); _inherited(...);
RemoveObject(); RemoveObject();
} }
@ -52,13 +52,13 @@ private func Sleep()
private func SleepComplete() private func SleepComplete()
{ {
SetAction("Sleep"); SetAction("Sleep");
_inherited(); _inherited(...);
} }
private func WakeUp() private func WakeUp()
{ {
SetAction("Fly"); SetAction("Fly");
_inherited(); _inherited(...);
} }
// Array: [object lovely_object, int x, int y] // Array: [object lovely_object, int x, int y]

View File

@ -103,7 +103,7 @@ public func Construction()
_inherited(...); _inherited(...);
// setup of the force fields after the call to inherited() // setup of the force fields after the call to inherited(...)
SetDefaultForceFieldMaxDistance(SQUID_VISION_MAX_RANGE); SetDefaultForceFieldMaxDistance(SQUID_VISION_MAX_RANGE);
SetDefaultForceFieldTTD(36 * 4); SetDefaultForceFieldTTD(36 * 4);
SetMaxEmitterNumber(7); SetMaxEmitterNumber(7);

View File

@ -44,12 +44,12 @@ private func Initialize()
SetAction("Fly"); SetAction("Fly");
SetPhase(Random(3)); SetPhase(Random(3));
_inherited(); _inherited(...);
} }
private func Death() private func Death()
{ {
_inherited(); _inherited(...);
RemoveObject(); RemoveObject();
} }
@ -58,7 +58,7 @@ private func MissionComplete()
if (enraged) if (enraged)
MoveToTarget(); MoveToTarget();
else else
_inherited(); _inherited(...);
} }
private func Sleep() private func Sleep()
@ -82,13 +82,13 @@ private func Sleep()
private func SleepComplete() private func SleepComplete()
{ {
SetAction("Sleep"); SetAction("Sleep");
_inherited(); _inherited(...);
} }
private func WakeUp() private func WakeUp()
{ {
SetAction("Fly"); SetAction("Fly");
_inherited(); _inherited(...);
} }
private func GetAttraction(proplist coordinates) private func GetAttraction(proplist coordinates)

View File

@ -7,7 +7,7 @@ local back;
private func Initialize() private func Initialize()
{ {
this.cover_area = Shape->Rectangle(-118, -31, 236, 62); this.cover_area = Shape->Rectangle(-118, -31, 236, 62);
_inherited(); _inherited(...);
} }
public func Set(object trunk) public func Set(object trunk)

View File

@ -168,7 +168,7 @@ public func HasInteractionMenu() { return true; }
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var pipe_menu = var pipe_menu =
{ {

View File

@ -40,13 +40,13 @@ public func SaveScenarioObject(props, ...)
public func TurnOn() public func TurnOn()
{ {
_inherited(); _inherited(...);
SetMeshMaterial("LanternLit", 1); SetMeshMaterial("LanternLit", 1);
} }
public func TurnOff() public func TurnOff()
{ {
_inherited(); _inherited(...);
SetMeshMaterial("LanternGlass", 1); SetMeshMaterial("LanternGlass", 1);
} }

View File

@ -41,7 +41,7 @@ public func GetLadderData()
{ {
if (master) if (master)
return master->~GetLadderData(index); return master->~GetLadderData(index);
return _inherited(); return _inherited(...);
} }
public func OnLadderGrab(object clonk) public func OnLadderGrab(object clonk)

View File

@ -105,7 +105,7 @@ private func Death()
lib_swarm_previnline->SetNextInLine(lib_swarm_nextinline); lib_swarm_previnline->SetNextInLine(lib_swarm_nextinline);
} }
PurgeLine(); // Don't do everything twice in case Destruction() follows PurgeLine(); // Don't do everything twice in case Destruction() follows
_inherited(); _inherited(...);
} }
private func Destruction() private func Destruction()
@ -131,7 +131,7 @@ private func PurgeLine()
private func MoveToTarget() private func MoveToTarget()
{ {
if (!lib_swarm_helper || (lib_swarm_helper->GetMaster() == this)) if (!lib_swarm_helper || (lib_swarm_helper->GetMaster() == this))
return _inherited(); return _inherited(...);
var x, y; var x, y;
// Follow previous in line // Follow previous in line

View File

@ -13,7 +13,7 @@
(object) menu control, hotkey controls, usage and it's callbacks and (object) menu control, hotkey controls, usage and it's callbacks and
forwards to script. forwards to script.
Objects that inherit this object need to return _inherited() in the Objects that inherit this object need to return _inherited(...) in the
following callbacks (if defined): following callbacks (if defined):
Construction, Collection2, Ejection, RejectCollect, Departure, Construction, Collection2, Ejection, RejectCollect, Departure,
Entrance, AttachTargetLost, CrewSelection, Death, Entrance, AttachTargetLost, CrewSelection, Death,

View File

@ -12,7 +12,7 @@ private func Initialize()
{ {
AddTimer("CheckCoverage", 1); AddTimer("CheckCoverage", 1);
this.Visibility = [VIS_Select]; this.Visibility = [VIS_Select];
_inherited(); _inherited(...);
} }
private func CheckCoverage() private func CheckCoverage()

View File

@ -4,7 +4,7 @@
Clonk-side scripts for the HUD. This object basically redirects the Clonk-side scripts for the HUD. This object basically redirects the
engine callbacks for the clonk to the HUD. All crew members that engine callbacks for the clonk to the HUD. All crew members that
are to be shown in the HUD have to include this object and return are to be shown in the HUD have to include this object and return
_inherited(); if they overload one of the callbacks used here. _inherited(...); if they overload one of the callbacks used here.
This adapter redirects to the per player HUD controller and also This adapter redirects to the per player HUD controller and also
directly to the per clonk HUD selector. directly to the per clonk HUD selector.

View File

@ -53,7 +53,7 @@ public func IsLiquidTank() { return true;}
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
if (CanConnectPipe()) if (CanConnectPipe())
{ {

View File

@ -34,7 +34,7 @@
Most objects which can be stacked might want to set different pictures Most objects which can be stacked might want to set different pictures
and ingame graphics for different counts of objects. This can be done and ingame graphics for different counts of objects. This can be done
by overloading UpdatePicture(), but remember to write _inherited() then. by overloading UpdatePicture(), but remember to write _inherited(...) then.
--*/ --*/

View File

@ -17,7 +17,7 @@ public func HasInteractionMenu() { return true; }
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
// Only add a power menu if the structure is a flagpole (Library_Flag). // Only add a power menu if the structure is a flagpole (Library_Flag).
// And only if a power network is already initialized for this object. // And only if a power network is already initialized for this object.
if (this->~IsFlagpole() && this->GetPowerHelper()) if (this->~IsFlagpole() && this->GetPowerHelper())

View File

@ -142,7 +142,7 @@ public func GetProductionMenuEntries(object clonk)
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var prod_menu = var prod_menu =
{ {
title = "$Production$", title = "$Production$",

View File

@ -270,7 +270,7 @@ public func RejectInteractionMenu(object clonk)
// Show damage and allow a player to repair the building when damaged. // Show damage and allow a player to repair the building when damaged.
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var damage_menu = var damage_menu =
{ {
title = "$Damage$", title = "$Damage$",

View File

@ -170,7 +170,7 @@ public func HasInteractionMenu() { return true; }
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
// only open the menus if ready // only open the menus if ready
if (this->AllowBuyMenuEntries()) if (this->AllowBuyMenuEntries())
{ {

View File

@ -71,7 +71,7 @@ public func GetMissingMaterialMenuEntries(object clonk)
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var comp_menu = var comp_menu =
{ {
title = "$TxtMissingMaterial$", title = "$TxtMissingMaterial$",

View File

@ -96,7 +96,7 @@ private func Initialize()
else else
partner = nil; partner = nil;
} }
return _inherited(); return _inherited(...);
} }
private func CreateCase() private func CreateCase()

View File

@ -122,7 +122,7 @@ func GetPumpMenuEntry(proplist custom_entry, symbol, string text, int priority,
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var prod_menu = var prod_menu =
{ {
title = "$Control$", title = "$Control$",

View File

@ -93,7 +93,7 @@ public func HasInteractionMenu() { return true; }
// Show a helpful hint to the player. The hint is colored and titled the same as the production menu for more visual coherence. // Show a helpful hint to the player. The hint is colored and titled the same as the production menu for more visual coherence.
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var prod_menu = var prod_menu =
{ {
title = "$Production$", title = "$Production$",

View File

@ -131,7 +131,7 @@ public func HasInteractionMenu() { return true; }
// Show hint about efficiency in the interaction menu. // Show hint about efficiency in the interaction menu.
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var prod_menu = var prod_menu =
{ {
title = "$Efficiency$", title = "$Efficiency$",

View File

@ -15,7 +15,7 @@ protected func Construction()
var graphic = Random(6); var graphic = Random(6);
if(graphic) if(graphic)
SetGraphics(Format("%d",graphic)); SetGraphics(Format("%d",graphic));
_inherited(); _inherited(...);
if(GetCon() < 100) SetCon(100); if(GetCon() < 100) SetCon(100);
} }

View File

@ -37,7 +37,7 @@ public func Open(clonk)
GameCall("OnChestOpened", clonk); GameCall("OnChestOpened", clonk);
Sound("Toot"); Sound("Toot");
ScheduleCall(this, "DoTheConfetti", 2, 20); ScheduleCall(this, "DoTheConfetti", 2, 20);
return inherited(); return inherited(clonk, ...);
} }
public func DoTheConfetti() public func DoTheConfetti()

View File

@ -4,6 +4,6 @@
protected func Initialize() protected func Initialize()
{ {
_inherited(); _inherited(...);
SetHalfVehicleSolidMask(true); SetHalfVehicleSolidMask(true);
} }

View File

@ -56,7 +56,7 @@ public func HasInteractionMenu() { return true; }
public func GetInteractionMenus(object clonk) public func GetInteractionMenus(object clonk)
{ {
var menus = _inherited() ?? []; var menus = _inherited(clonk, ...) ?? [];
var oil_menu = var oil_menu =
{ {
title = "$MsgOilOverview$", title = "$MsgOilOverview$",