Small stuff:
- Debug console's :spawn now uses a proper js method, instead of legacy_addShips. - the new looser definition of 'thargon' now applies to all equipment methods. - faster switch between in-flight sunlight & GUI lighting. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2942 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
c1cdf6f2df
commit
e81b28dc7f
@ -97,7 +97,7 @@
|
|||||||
"logOff" = "console.setDisplayMessagesInClass(PARAM, false)";
|
"logOff" = "console.setDisplayMessagesInClass(PARAM, false)";
|
||||||
|
|
||||||
// ":spawn foo" -- create a ship with role "foo" near the station.
|
// ":spawn foo" -- create a ship with role "foo" near the station.
|
||||||
"spawn" = "system.legacy_addShipsWithinRadius(PARAM, 1, 'abs', player.ship.position, 10000)";
|
"spawn" = "system.addShips(PARAM, 1, player.ship.position, 10000)";
|
||||||
|
|
||||||
// ":qotd" -- quote of the day. Or the moment, anyway.
|
// ":qotd" -- quote of the day. Or the moment, anyway.
|
||||||
"qotd" = "expandDescription('[thargoid_curses]')";
|
"qotd" = "expandDescription('[thargoid_curses]')";
|
||||||
|
@ -2017,7 +2017,7 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
|
|||||||
equipmentKey = [equipmentKey substringToIndex:[equipmentKey length] - [@"_DAMAGED" length]];
|
equipmentKey = [equipmentKey substringToIndex:[equipmentKey length] - [@"_DAMAGED" length]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([equipmentKey hasSuffix:@"MISSILE"]||[equipmentKey hasSuffix:@"MINE"]||([self isThargoid] && [equipmentKey isEqualToString:@"thargon"]))
|
if ([equipmentKey hasSuffix:@"MISSILE"]||[equipmentKey hasSuffix:@"MINE"]||([self isThargoid] && ([equipmentKey hasPrefix:@"thargon"] || [equipmentKey hasSuffix:@"thargon"])))
|
||||||
{
|
{
|
||||||
if (missiles >= max_missiles) return NO;
|
if (missiles >= max_missiles) return NO;
|
||||||
}
|
}
|
||||||
@ -2179,7 +2179,7 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
|
|||||||
|
|
||||||
// special cases
|
// special cases
|
||||||
|
|
||||||
if ([equipmentKey hasSuffix:@"MISSILE"]||[equipmentKey hasSuffix:@"MINE"]||([self isThargoid] && [equipmentKey isEqualToString:@"thargon"]))
|
if ([equipmentKey hasSuffix:@"MISSILE"]||[equipmentKey hasSuffix:@"MINE"]||([self isThargoid] && ([equipmentKey hasPrefix:@"thargon"] || [equipmentKey hasSuffix:@"thargon"])))
|
||||||
{
|
{
|
||||||
if (missiles >= max_missiles) return NO;
|
if (missiles >= max_missiles) return NO;
|
||||||
|
|
||||||
@ -2189,7 +2189,7 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// don't add any thargons to non-thargoid ships.
|
// don't add any thargons to non-thargoid ships.
|
||||||
if([equipmentKey isEqualToString:@"thargon"]) return NO;
|
if([equipmentKey hasPrefix:@"thargon"] || [equipmentKey hasSuffix:@"thargon"]) return NO;
|
||||||
|
|
||||||
// we can theoretically add a damaged weapon, but not a working one.
|
// we can theoretically add a damaged weapon, but not a working one.
|
||||||
if([equipmentKey hasPrefix:@"EQ_WEAPON"] && ![equipmentKey hasSuffix:@"_DAMAGED"])
|
if([equipmentKey hasPrefix:@"EQ_WEAPON"] && ![equipmentKey hasSuffix:@"_DAMAGED"])
|
||||||
@ -2262,7 +2262,7 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
|
|||||||
OOEquipmentType *eqType = [OOEquipmentType equipmentTypeWithIdentifier:equipmentTypeCheckKey];
|
OOEquipmentType *eqType = [OOEquipmentType equipmentTypeWithIdentifier:equipmentTypeCheckKey];
|
||||||
if (eqType == nil) return;
|
if (eqType == nil) return;
|
||||||
|
|
||||||
if ([eqType isMissileOrMine] || ([self isThargoid] && [equipmentTypeCheckKey isEqualToString:@"thargon"]))
|
if ([eqType isMissileOrMine] || ([self isThargoid] && ([equipmentKey hasPrefix:@"thargon"] || [equipmentKey hasSuffix:@"thargon"])))
|
||||||
{
|
{
|
||||||
[self removeExternalStore:eqType];
|
[self removeExternalStore:eqType];
|
||||||
}
|
}
|
||||||
|
@ -3491,11 +3491,6 @@ void setSunLight(BOOL yesno)
|
|||||||
if (yesno) OOGL(glEnable(GL_LIGHT1));
|
if (yesno) OOGL(glEnable(GL_LIGHT1));
|
||||||
else OOGL(glDisable(GL_LIGHT1));
|
else OOGL(glDisable(GL_LIGHT1));
|
||||||
sun_light_on = yesno;
|
sun_light_on = yesno;
|
||||||
if(sun_light_on)
|
|
||||||
{
|
|
||||||
if ([UNIVERSE sun]) [UNIVERSE setSunCenterPosition: [[UNIVERSE sun] position]]; // test EW reset light1 to sun
|
|
||||||
else [UNIVERSE setSunCenterPosition: kZeroVector];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3617,10 +3612,15 @@ static const OOMatrix starboard_matrix =
|
|||||||
int i, v_status;
|
int i, v_status;
|
||||||
Vector position, obj_position, view_dir, view_up;
|
Vector position, obj_position, view_dir, view_up;
|
||||||
OOMatrix view_matrix;
|
OOMatrix view_matrix;
|
||||||
BOOL inGUIMode = NO;
|
|
||||||
int ent_count = n_entities;
|
int ent_count = n_entities;
|
||||||
Entity *my_entities[ent_count];
|
Entity *my_entities[ent_count];
|
||||||
int draw_count = 0;
|
int draw_count = 0;
|
||||||
|
PlayerEntity *player = [PlayerEntity sharedPlayer];
|
||||||
|
Entity *drawthing = nil;
|
||||||
|
OOCamera *camera = [player currentCamera];
|
||||||
|
BOOL inGUIMode = [player showDemoShips];;
|
||||||
|
|
||||||
|
if (!inGUIMode && [UNIVERSE sun]) [UNIVERSE setSunCenterPosition: [[UNIVERSE sun] position]]; // reset light1 to sun's position
|
||||||
|
|
||||||
// use a non-mutable copy so this can't be changed under us.
|
// use a non-mutable copy so this can't be changed under us.
|
||||||
for (i = 0; i < ent_count; i++)
|
for (i = 0; i < ent_count; i++)
|
||||||
@ -3639,14 +3639,6 @@ static const OOMatrix starboard_matrix =
|
|||||||
my_entities[draw_count++] = [e retain]; // retained
|
my_entities[draw_count++] = [e retain]; // retained
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerEntity *player = [PlayerEntity sharedPlayer];
|
|
||||||
Entity *drawthing = nil;
|
|
||||||
OOCamera *camera = [player currentCamera];
|
|
||||||
camera = camera;
|
|
||||||
|
|
||||||
position = kZeroVector;
|
|
||||||
|
|
||||||
inGUIMode = [player showDemoShips];
|
|
||||||
position = [player viewpointPosition];
|
position = [player viewpointPosition];
|
||||||
v_status = [player status];
|
v_status = [player status];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user