Objects: Some fixes to cable network

Removed some erroring code from the libraries.
Maikel de Vries 2011-04-11 18:08:57 +02:00
parent 5da93528c6
commit d515df6055
6 changed files with 9 additions and 11 deletions

View File

@ -50,7 +50,7 @@ public func SetDestination(dest)
{
if(GetType(dest) == C4V_Int)
{
dest = FindObjects(Find_ID(CableCrossing))[dest];
dest = FindObjects(Find_Func("IsCableCrossing"))[dest];
}
rail_destination = dest;
if(rail_direction == 0)
@ -194,7 +194,7 @@ private func MoveTo(dest)
{
if(GetType(dest) == C4V_Int)
{
dest = FindObjects(Find_ID(CableCrossing))[dest];
dest = FindObjects(Find_Func("IsCableCrossing"))[dest];
}
var rail = 0;
for(var test_rail in FindObjects(Find_Func("IsConnectedTo", pRailTarget)))

View File

@ -2,4 +2,7 @@
id=Library_CableStation
Version=4,10,0,0
Category=C4D_StaticBack
Width=20
Height=20
Offset=-10,-10
Picture=0,0,64,64

View File

@ -345,7 +345,7 @@ public func AddNeighboursToList()
var obj;
for(var i = 0; i < GetLength(aPath); i++)
{
obj = aPath[i]->GetOtherConnection(this);//EffectVar(0,this(),aPath[i]);
obj = aPath[i]->~GetOtherConnection(this);//EffectVar(0,this(),aPath[i]);
aConnectionList[i] = [obj, obj, ObjectDistance(obj)];
}
}
@ -357,7 +357,7 @@ public func AddNeighboursList()
var newList, obj, dist, pEnd;
for(var i = 0; i < GetLength(aPath); i++)
{
obj = aPath[i]->GetOtherConnection(this);
obj = aPath[i]->~GetOtherConnection(this);
dist = ObjectDistance(obj);
// Get aConnectionList from the next waypoint in line
newList = obj->GetList();
@ -467,7 +467,7 @@ private func CheckRailStation()
{
if (!is_station)
{
SetGraphics("Station", CableCrossing, 2, GFXOV_MODE_Base);
SetGraphics("Station", Library_CableStation, 2, GFXOV_MODE_Base);
is_station = true;
}
}

View File

@ -49,18 +49,16 @@ private func Produce(id item_id)
if (IsProducing())
return false;
// Start production.
var effect = AddEffect("Producing", this, 100, 1, this, nil, item_id);
AddEffect("Producing", this, 100, 1, this, nil, item_id);
return true;
}
// Production effect: effect.ItemID is the item under production.
protected func FxProducingStart(object target, proplist effect, int temp, id item_id)
{
Log("%v", temp);
if (temp)
return 1;
effect.ItemID = item_id;
Log("%v", effect.ItemID);
// Remove raw materials, then commence production.
var costs = ProductionCosts(item_id);
for (var mat in costs)
@ -71,7 +69,6 @@ protected func FxProducingStart(object target, proplist effect, int temp, id ite
protected func FxProducingTimer(object target, proplist effect, int time)
{
Log("I am Producing%v", time);
// Production already done?
if (time > 150) // Replace me with something sensible.
return -1;
@ -125,7 +122,6 @@ protected func SelectProduction(id item_id)
private func Smoking()
{
if (GetPhase()%3) return 1;
if (Random(6)) Smoke(+16,-14,16);
if (Random(8)) Smoke(10,-14,15+Random(3));
return 1;

View File

@ -21,7 +21,6 @@ protected func Initialize()
CreateObject(CableLine, 191, 438)->SetConnectedObjects(cross7, cross4);
//CreateObject(CableLine, 191, 438)->SetConnectedObjects(cross4, cross2);
CreateObject(CableLine, 191, 438)->SetConnectedObjects(cross1, tools);
WaypointsMakeList();
cross1->CreateContents(Ore, 5);
cross2->CreateContents(Coal, 8);