Skip to content

Commit

Permalink
Fixed: Fatal error loading a map with a missing/unknown plane material
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed May 1, 2012
1 parent 8cc2ab5 commit 76241c7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions doomsday/engine/portable/src/materials.c
Expand Up @@ -1035,25 +1035,29 @@ static void pushVariantCacheQueue(material_t* mat, const materialvariantspecific
void Materials_Precache2(material_t* mat, const materialvariantspecification_t* spec,
boolean smooth, boolean cacheGroup)
{
variantcachequeue_node_t* node;
assert(mat && spec);

errorIfNotInited("Materials::Precache");

// Don't precache when playing demo.
if(isDedicated || playback)
if(!mat || ! spec)
{
DEBUG_Message(("Materials_Precache: Invalid arguments mat:%p, spec:%p, ignoring.\n", mat, spec));
return;
}

// Don't precache when playing demo.
if(isDedicated || playback) return;

// Already in the queue?
{ variantcachequeue_node_t* node;
for(node = variantCacheQueue; node; node = node->next)
{
if(mat == node->mat && spec == node->spec) return;
}
}}

pushVariantCacheQueue(mat, spec, smooth);

if(cacheGroup && Material_IsGroupAnimated(mat))
{ // Material belongs in one or more animgroups; precache the group.
{
// Material belongs in one or more animgroups; precache the group.
int i, k;
for(i = 0; i < numgroups; ++i)
{
Expand Down

0 comments on commit 76241c7

Please sign in to comment.