Skip to content

Commit c166d6e

Browse files
Merge branch 'master' into issue-9916
2 parents c511f43 + 7519b14 commit c166d6e

19 files changed

+180
-20
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Go to '...'
13+
2. Click on '....'
14+
3. Scroll down to '....'
15+
4. See error
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Screenshots**
21+
If applicable, add screenshots to help explain your problem.
22+
23+
**MTA Client (please complete the following information):**
24+
- Version [e.g. 1.1, 1.5.4]
25+
- Running in Wine? [e.g, No, Yes - Linux, Yes - macOS]
26+
27+
**MTA Server (please complete the following information):**
28+
- OS: [e.g. Windows 7, Debian Stretch]
29+
- Version [e.g. 1.1, 1.5.4]
30+
31+
**Additional context**
32+
Add any other context about the problem here
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Security report
3+
about: Submit cheat or security vulnerability
4+
5+
---
6+
7+
Please submit your cheats or security vulnerabilities to @ccw on forum.mtasa.com. Please do not submit them here.
8+
9+
@ccw can be found here: https://forum.mtasa.com/profile/7264-ccw/

PULL_REQUEST_TEMPLATE.md renamed to .github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Only use pull requests to submit patches! Use [the bug tracker](https://bugs.multitheftauto.com) to report bugs, or [the forum](https://forum.mtasa.com) to ask for help!
2-
31
Before you go ahead and create a pull request, please make sure:
42

53
* [ ] [your code follows the coding guidelines](https://wiki.multitheftauto.com/index.php?title=Coding_guidelines)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Our project's code repository can be found on the [multitheftauto/mtasa-blue](https://github.com/multitheftauto/mtasa-blue/) Git repository at [GitHub](https://github.com/). We are always looking for new developers, so if you're interested, here are some useful links:
22

33
* [Nightly Builds](https://nightly.mtasa.com/)
4-
* [Bugtracker Roadmap](https://bugs.mtasa.com/roadmap_page.php)
4+
* [Issue Tracker](https://github.com/multitheftauto/mtasa-blue)
55
* [Wiki Roadmap](https://wiki.mtasa.com/wiki/Roadmap)
66

77
Before committing, please review the [coding guidelines](https://wiki.mtasa.com/index.php?title=Coding_guidelines).

Client/gui/CGUIMemo_Impl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ void CGUIMemo_Impl::SetVerticalScrollPosition(float fPosition)
111111
}
112112
}
113113

114+
float CGUIMemo_Impl::GetMaxVerticalScrollPosition(void)
115+
{
116+
return GetScrollbarDocumentSize() - GetScrollbarPageSize();
117+
}
118+
114119
float CGUIMemo_Impl::GetScrollbarDocumentSize(void)
115120
{
116121
CEGUI::Scrollbar* pScrollbar = reinterpret_cast<CEGUI::MultiLineEditbox*>(m_pWindow)->d_vertScrollbar;

Client/gui/CGUIMemo_Impl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class CGUIMemo_Impl : public CGUIMemo, public CGUIElement_Impl, public CGUITabLi
2929

3030
float GetVerticalScrollPosition(void);
3131
void SetVerticalScrollPosition(float fPosition);
32+
float GetMaxVerticalScrollPosition(void);
3233
float GetScrollbarDocumentSize(void);
3334
float GetScrollbarPageSize(void);
3435

Client/mods/deathmatch/logic/CClientIFP.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ CClientIFP::CClientIFP(class CClientManager* pManager, ElementID ID) : CClientEn
2424
m_u32Hashkey = 0;
2525
}
2626

27-
bool CClientIFP::LoadIFP(const SString& strFilePath, const SString& strBlockName)
27+
bool CClientIFP::LoadIFP(const SString& strFile, const bool isRawData, const SString& strBlockName)
2828
{
2929
m_strBlockName = strBlockName;
3030
m_pVecAnimations = &m_pIFPAnimations->vecAnimations;
3131

32-
if (LoadIFPFile(strFilePath))
32+
if (LoadIFPFile(strFile, isRawData))
3333
{
3434
m_u32Hashkey = HashString(strBlockName.ToLower());
3535
return true;
3636
}
3737
return false;
3838
}
3939

40-
bool CClientIFP::LoadIFPFile(const SString& strFilePath)
40+
bool CClientIFP::LoadIFPFile(const SString& strFile, const bool isRawData)
4141
{
42-
if (LoadFileToMemory(strFilePath))
42+
if (isRawData ? LoadDataBufferToMemory(strFile) : LoadFileToMemory(strFile))
4343
{
4444
if (ReadIFPByVersion())
4545
{

Client/mods/deathmatch/logic/CClientIFP.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class CClientIFP : public CClientEntity, CFileReader
205205
void MarkAsUnloading(void) { m_bUnloading = true; }
206206
bool IsUnloading(void) { return m_bUnloading; }
207207

208-
bool LoadIFP(const SString& strFilePath, const SString& strBlockName);
208+
bool LoadIFP(const SString& strFile, const bool isRawData, const SString& strBlockName);
209209

210210
const SString& GetBlockName(void) { return m_strBlockName; }
211211
const unsigned int& GetBlockNameHash(void) { return m_u32Hashkey; }
@@ -219,7 +219,7 @@ class CClientIFP : public CClientEntity, CFileReader
219219
void SetPosition(const CVector& vecPosition){};
220220

221221
private:
222-
bool LoadIFPFile(const SString& strFilePath);
222+
bool LoadIFPFile(const SString& strFile, const bool isRawData);
223223
bool ReadIFPByVersion(void);
224224
void ReadIFPVersion1(void);
225225
void ReadIFPVersion2(bool bAnp3);

Client/mods/deathmatch/logic/CFileReader.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,31 @@ void CFileReader::SkipBytes(const std::uint32_t u32BytesToSkip)
4545
bool CFileReader::LoadFileToMemory(const SString& strFilePath)
4646
{
4747
std::ifstream fileStream(FromUTF8(strFilePath), std::ios::binary | std::ios::ate);
48-
std::streamsize m_iFileSize = fileStream.tellg();
49-
if (m_iFileSize == eIFSTREAM::SIZE_ERROR)
48+
std::streamsize iFileSize = fileStream.tellg();
49+
if (iFileSize == eIFSTREAM::SIZE_ERROR)
5050
{
5151
return false;
5252
}
5353

5454
fileStream.seekg(0, std::ios::beg);
55-
m_vecFileDataBuffer.reserve(static_cast<size_t>(m_iFileSize));
56-
if (fileStream.read(m_vecFileDataBuffer.data(), m_iFileSize))
55+
m_vecFileDataBuffer.reserve(static_cast<size_t>(iFileSize));
56+
if (fileStream.read(m_vecFileDataBuffer.data(), iFileSize))
57+
{
58+
return true;
59+
}
60+
return false;
61+
}
62+
63+
bool CFileReader::LoadDataBufferToMemory(const SString& buffer)
64+
{
65+
std::streamsize iBufferSize = buffer.size();
66+
if (iBufferSize == eIFSTREAM::SIZE_ERROR)
67+
{
68+
return false;
69+
}
70+
71+
m_vecFileDataBuffer.reserve(static_cast<size_t>(iBufferSize));
72+
if (std::copy(buffer.begin(), buffer.end(), m_vecFileDataBuffer.data()))
5773
{
5874
return true;
5975
}

0 commit comments

Comments
 (0)