EntityList::element_t *EntityList::element_t::init(EntityList::element_t * ptr) { if (NULL == ptr) return NULL; BLANK_STRUCT_PTR(ptr) ptr->ichr = INVALID_CHR_REF; ptr->iprt = INVALID_PRT_REF; return ptr; }
//-------------------------------------------------------------------------------------------- bool link_push_module() { return false; //TODO: not ported #if 0 bool retval; link_stack_entry_t * pentry; PLA_REF ipla; if ( link_stack_count >= MAX_PLAYER || pickedmodule_index < 0 ) return false; // grab an entry pentry = link_stack + link_stack_count; BLANK_STRUCT_PTR( pentry ) // store the load name of the module strncpy( pentry->modname, mnu_ModList_get_vfs_path( pickedmodule_index ), SDL_arraysize( pentry->modname ) ); // find all of the exportable characters pentry->hero_count = 0; for ( ipla = 0; ipla < MAX_PLAYER; ipla++ ) { ObjectRef ichr; Object * pchr; hero_spawn_data_t * phero; if ( !PlaStack.lst[ipla].valid ) continue; // Is it alive? ichr = PlaStack.lst[ipla].index; if ( !_currentModule->getObjectHandler().exists( ichr ) ) continue; pchr = _currentModule->getObjectHandler().get( ichr ); if ( pentry->hero_count < LINK_HEROES_MAX ) { phero = pentry->hero + pentry->hero_count; pentry->hero_count++; // copy some important info phero->object_index = REF_TO_INT( pchr->getProfileID() ); phero->pos_stt.x = pchr->pos_stt.x; phero->pos_stt.y = pchr->pos_stt.y; phero->pos_stt.z = pchr->pos_stt.z; chr_get_pos( pchr, phero->pos.v ); } } // the function only succeeds if at least one hero's info was cached retval = false; if ( pentry->hero_count > 0 ) { link_stack_count++; retval = true; } return retval; #endif }