Skip to content

Make World Accessible for CSQC getsurface functions ... #281

@Baker7

Description

@Baker7

The CSQC getsurface functions fail in CSQC always because the modelindex is 0 (because it is not set).

To make it work, requires a single line of code ... (the world is always modelindex 1)

csprogs.c ===> CL_VM_Init ...

	// set map description (use world entity 0)
	PRVM_clientedictstring(prog->edicts, message) = PRVM_SetEngineString(prog, cl.worldmessage);
	
	PRVM_clientedictfloat(prog->edicts, modelindex) = 1; // Baker: World is always 1 - August 14 2025 <=== this line
	VectorCopy(cl.world.mins, PRVM_clientedictvector(prog->edicts, mins));
	VectorCopy(cl.world.maxs, PRVM_clientedictvector(prog->edicts, maxs));
	VectorCopy(cl.world.mins, PRVM_clientedictvector(prog->edicts, absmin));
	VectorCopy(cl.world.maxs, PRVM_clientedictvector(prog->edicts, absmax));

I made it work in CSQC_Init I set world.modelindex = 1 --- the engine hates that and prints a warning, but makes it work with DarkPlaces 2014 or later version so at least I get to keep maximum compatibility.

Link to DarkPlaces 2014 or later mod using the above https://www.moddb.com/mods/zircon-engine/downloads/csqc-rain-snow-ultra-hd-for-almost-any-mod

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions