This repository was archived by the owner on Mar 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplugin.cpp
More file actions
71 lines (57 loc) · 1.4 KB
/
Copy pathplugin.cpp
File metadata and controls
71 lines (57 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
QMM - Q3 MultiMod
Copyright 2004-2024
https://github.com/thecybermind/qmm/
3-clause BSD license: https://opensource.org/license/bsd-3-clause
Created By:
Kevin Masterson < cybermind@gmail.com >
*/
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "CModMgr.h"
#include "qmm.h"
#include "qmmapi.h"
#include "util.h"
#include "CLinkList.h"
static int plugin_WriteGameLog(const char* text, int len = -1) {
return log_write(text, len);
}
static char* plugin_VarArgs(char* format, ...) {
va_list argptr;
static char str[8][1024];
static int index = 0;
int i = index;
va_start(argptr, format);
vsnprintf(str[i], sizeof(str[i]), format, argptr);
va_end(argptr);
index = (index + 1) & 7;
return str[i];
}
static int plugin_IsVM() {
return g_ModMgr->Mod()->IsVM();
}
static const char* plugin_EngMsgName(int x) {
return ENG_MSGNAME(x);
}
static const char* plugin_ModMsgName(int x) {
return MOD_MSGNAME(x);
}
static int plugin_GetIntCvar(const char* cvar) {
return get_int_cvar(cvar);
}
static const char* plugin_GetStrCvar(const char* cvar) {
return get_str_cvar(cvar);
}
static pluginfuncs_t s_pluginfuncs = {
&plugin_WriteGameLog,
&plugin_VarArgs,
&plugin_IsVM,
&plugin_EngMsgName,
&plugin_ModMsgName,
&plugin_GetIntCvar,
&plugin_GetStrCvar,
};
pluginfuncs_t* get_pluginfuncs() {
return &s_pluginfuncs;
}