(String filename)
| 1642 | } |
| 1643 | |
| 1644 | @Override |
| 1645 | public void ReadLevel(String filename) { |
| 1646 | try { |
| 1647 | |
| 1648 | QuakeFile f = new QuakeFile(filename, "r"); |
| 1649 | |
| 1650 | num_edicts = game.maxclients + 1; |
| 1651 | |
| 1652 | // load the level locals |
| 1653 | level.read(f, g_edicts); |
| 1654 | |
| 1655 | // load all the entities |
| 1656 | while (true) { |
| 1657 | int entnum = f.readInt(); |
| 1658 | if (entnum == -1) |
| 1659 | break; |
| 1660 | |
| 1661 | if (entnum >= num_edicts) |
| 1662 | num_edicts = entnum + 1; |
| 1663 | |
| 1664 | SubgameEntity ent = g_edicts[entnum]; |
| 1665 | ent.read(f, g_edicts, game.clients, this); |
| 1666 | ent.cleararealinks(); |
| 1667 | gameImports.linkentity(ent); |
| 1668 | } |
| 1669 | |
| 1670 | Lib.fclose(f); |
| 1671 | |
| 1672 | // mark all clients as unconnected |
| 1673 | for (int i = 0; i < game.maxclients; i++) { |
| 1674 | SubgameEntity ent = g_edicts[i + 1]; |
| 1675 | ent.setClient(game.clients[i]); |
| 1676 | gclient_t client = ent.getClient(); |
| 1677 | client.pers.connected = false; |
| 1678 | } |
| 1679 | |
| 1680 | // do any load time things at this point |
| 1681 | for (int i = 0; i < num_edicts; i++) { |
| 1682 | SubgameEntity ent = g_edicts[i]; |
| 1683 | |
| 1684 | if (!ent.inuse) |
| 1685 | continue; |
| 1686 | |
| 1687 | // fire any cross-level triggers |
| 1688 | if ("target_crosslevel_target".equals(ent.classname)) |
| 1689 | ent.think.nextTime = level.time + ent.delay; |
| 1690 | } |
| 1691 | } catch (Exception e) { |
| 1692 | e.printStackTrace(); |
| 1693 | } |
| 1694 | } |
| 1695 | |
| 1696 | @Override |
| 1697 | public void SpawnEntities(String mapname, String entities, String spawnpoint) { |
nothing calls this directly
no test coverage detected