• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ disable player block spawn in TFS 1.X

Arkemis

Well-Known Member
Joined
Sep 4, 2021
Messages
90
Reaction score
68
Location
United States
TFS 1.3 (Nekiro Downgrade 8.6)
cip Client 8.6

So I finished downgrading my monster pack to 8.6 (my first big endeavor!) and it went really well. Now I've officially begun building my custom map and I built a test spawn. The spawn-time on each of the monsters is 1, but player blocks spawn.

I searched the forum and found some solutions for older TFS versions and it led me to this snippet of code in "src/spawn.cpp", but its a bit different than the instructions, and admittedly im just beginning to learn C++ and I'm not sure what to remove/edit to stop players blocking spawns.
C++:
void Spawn::checkSpawn()
{
    checkSpawnEvent = 0;

    cleanup();

    uint32_t spawnCount = 0;

    for (auto& it : spawnMap) {
        uint32_t spawnId = it.first;
        if (spawnedMap.find(spawnId) != spawnedMap.end()) {
            continue;
        }

        spawnBlock_t& sb = it.second;
        if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
            if (!spawnMonster(spawnId, sb)) {
                sb.lastSpawn = OTSYS_TIME();
                continue;
            }

            if (++spawnCount >= static_cast<uint32_t>(g_config.getNumber(ConfigManager::RATE_SPAWN))) {
                break;
            }
        }
    }

1631514393911.png
 
Last edited:
Solution
TFS 1.3 (Nekiro Downgrade 8.6)
cip Client 8.6

So I finished downgrading my monster pack to 8.6 (my first big endeavor!) and it went really well. Now I've officially begun building my custom map and I built a test spawn. The spawn-time on each of the monsters is 1, but player blocks spawn.

I searched the forum and found some solutions for older TFS versions and it led me to this snippet of code in "src/spawn.cpp", but its a bit different than the instructions, and admittedly im just beginning to learn C++ and I'm not sure what to remove/edit to stop players blocking spawns.
C++:
void Spawn::checkSpawn()
{
    checkSpawnEvent = 0;

    cleanup();

    uint32_t spawnCount = 0;

    for (auto& it : spawnMap) {
        uint32_t spawnId =...
TFS 1.3 (Nekiro Downgrade 8.6)
cip Client 8.6

So I finished downgrading my monster pack to 8.6 (my first big endeavor!) and it went really well. Now I've officially begun building my custom map and I built a test spawn. The spawn-time on each of the monsters is 1, but player blocks spawn.

I searched the forum and found some solutions for older TFS versions and it led me to this snippet of code in "src/spawn.cpp", but its a bit different than the instructions, and admittedly im just beginning to learn C++ and I'm not sure what to remove/edit to stop players blocking spawns.
C++:
void Spawn::checkSpawn()
{
    checkSpawnEvent = 0;

    cleanup();

    uint32_t spawnCount = 0;

    for (auto& it : spawnMap) {
        uint32_t spawnId = it.first;
        if (spawnedMap.find(spawnId) != spawnedMap.end()) {
            continue;
        }

        spawnBlock_t& sb = it.second;
        if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
            if (!spawnMonster(spawnId, sb)) {
                sb.lastSpawn = OTSYS_TIME();
                continue;
            }

            if (++spawnCount >= static_cast<uint32_t>(g_config.getNumber(ConfigManager::RATE_SPAWN))) {
                break;
            }
        }
    }

View attachment 62058

In your TFS its in spawnMonster function, line 290 to be exact (TFS-1.4-Downgrades/spawn.cpp at 8.60 · nekiro/TFS-1.4-Downgrades (https://github.com/nekiro/TFS-1.4-Downgrades/blob/8.60/src/spawn.cpp#L290))

Just change it to bool isBlocked = false; to make all monster spawn even if player on screen.
Or you can set the flag in the xml files isIgnoringSpawnBlock
 
Solution
Back
Top