- Timestamp:
- 06/02/04 18:06:19 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/simulation/BaseEntityCollection.cpp
r325 r356 4 4 #include "ObjectManager.h" 5 5 #include "Model.h" 6 #include "io.h"7 6 8 7 void CBaseEntityCollection::loadTemplates() 9 8 { 10 _finddata_t file;11 intptr_t handle;12 9 Handle handle; 10 vfsDirEnt dent; 11 13 12 CStr pathname = "mods/official/entities/templates/"; 14 CStr filespec = pathname + "*.xml"; 15 16 handle = _findfirst( filespec, &file ); 17 if( handle != -1 ) 18 { 19 do 13 handle=vfs_open_dir("entities/templates/"); 14 if (handle > 0) 15 { 16 while (vfs_next_dirent(handle, &dent, ".xml")) 20 17 { 21 18 CBaseEntity newTemplate; 22 if( newTemplate.loadXML( pathname + file.name ) ) 19 if( newTemplate.loadXML( pathname + dent.name ) ) 20 { 23 21 addTemplate( newTemplate ); 22 LOG(NORMAL, "CBaseEntityCollection::loadTemplates(): Loaded template \"%s%s\"", pathname.c_str(), dent.name); 23 } 24 else 25 LOG(ERROR, "CBaseEntityCollection::loadTemplates(): Couldn't load template \"%s%s\"", pathname.c_str(), dent.name); 26 24 27 } 25 while( !_findnext( handle, &file ) ); 26 27 _findclose(handle); 28 vfs_close_dir(handle); 28 29 } 29 30 else 31 { 32 LOG(ERROR, "CBaseEntityCollection::loadTemplates(): Failed to enumerate entity template directory\n"); 33 return; 34 } 35 30 36 // He's so annoyingly slow... 31 37 CBaseEntity* dude = getTemplate( "Prometheus Dude" ); 32 38 dude->m_speed *= 10.0f; 33 34 39 } 35 40
Note:
See TracChangeset
for help on using the changeset viewer.
