fix for sao factory to support random prototype creation order

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

fix for sao factory to support random prototype creation order

by sapier » Sun Jan 15, 2012 12:44

This is part of the SAO/CAO split series but applies without the other patches too.

What does this patch:

By now SAO's depend on factory map beeing initialized before creation of any prototype. This is ensured by compiler for global variables within one file. If prototypes are created from separate files (e.g. after splitting one big file to multiple others) this ain't guaranteed anymore.

This patch ensures initialization of factory-map on first use (thx to kahrl for the idea).

Patch V1
DON'T mention coding style!
(c) sapier all rights reserved
 

Return to Minetest Engine

Who is online

Users browsing this forum: No registered users and 4 guests

cron