Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

objerror

From Quake Wiki

void objerror(string message)

Usage[edit]

Throws an error related to the current self entity. Information about this entity is dumped in the console. This entity is also removed and execution of its code will stop. This should be used for culling improperly set up entities or ones that enter invalid states.

Parameters[edit]

  • message
The message to display alongside the entity information dump in the console.

Example[edit]

// This entity assumes it will have a valid target id
// If not, it removes itself with an error
void func_my_entity()
{
    if (!self.target)
        objerror("func_my_entity was not given a valid target id\n");

    // ...
}