- Fixed a sometimes not executed "shipSpawned()" event for scripted cargo.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3193 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Eric Walch 2010-04-22 19:05:26 +00:00
parent 66fbfc1c1c
commit 4ddc56153a

View File

@ -1692,9 +1692,10 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
if (!haveExecutedSpawnAction) if (!haveExecutedSpawnAction)
{ {
// we only want shipSpawned to be triggered if this is a ship (including carriers and cargo pods), not for a stationary err... station! // we only want shipSpawned to be triggered if this is a ship (including carriers and cargo pods), not for a stationary err... station!
// When crashing into a boulder, STATUS_LAUNCHING is sometimes skipped on scooping the resulting splinters.
// FIXME: do we want shipSpawned to work for asteroids / rock hermits too ? if not: // FIXME: do we want shipSpawned to work for asteroids / rock hermits too ? if not:
//if (script != nil && [self scanClass] != CLASS_ROCK && ([self status] == STATUS_IN_FLIGHT || [self status] == STATUS_LAUNCHING)) //if (script != nil && [self scanClass] != CLASS_ROCK && ([self status] == STATUS_IN_FLIGHT || [self status] == STATUS_LAUNCHING))
if (script != nil && ([self status] == STATUS_IN_FLIGHT || [self status] == STATUS_LAUNCHING)) if (script != nil && ([self status] == STATUS_IN_FLIGHT || [self status] == STATUS_LAUNCHING|| [self status] == STATUS_BEING_SCOOPED))
{ {
PlayerEntity *player = [PlayerEntity sharedPlayer]; PlayerEntity *player = [PlayerEntity sharedPlayer];
[player setScriptTarget:self]; [player setScriptTarget:self];